summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /LayoutTests
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange-expected.txt16
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange.html13
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/script-tests/create-event-onorientationchange.js18
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js2
-rw-r--r--LayoutTests/fast/encoding/bracket-in-script-expected.txt4
-rw-r--r--LayoutTests/fast/encoding/bracket-in-script.html27
-rw-r--r--LayoutTests/fast/encoding/bracket-in-tag-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/bracket-in-tag.html23
-rw-r--r--LayoutTests/fast/encoding/char-decoding-expected.txt13
-rw-r--r--LayoutTests/fast/encoding/char-decoding.html20
-rw-r--r--LayoutTests/fast/encoding/escaped-bracket-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/escaped-bracket.html28
-rw-r--r--LayoutTests/fast/encoding/meta-in-body-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/meta-in-body.html24
-rw-r--r--LayoutTests/fast/encoding/meta-in-script-expected.txt3
-rw-r--r--LayoutTests/fast/encoding/meta-in-script.html26
-rw-r--r--LayoutTests/fast/encoding/meta-in-title-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/meta-in-title.html27
-rw-r--r--LayoutTests/fast/encoding/mismatched-end-tag-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/mismatched-end-tag.html24
-rw-r--r--LayoutTests/fast/encoding/namespace-meta-expected.txt3
-rw-r--r--LayoutTests/fast/encoding/namespace-meta.html24
-rw-r--r--LayoutTests/fast/encoding/namespace-tolerance.html2
-rw-r--r--LayoutTests/fast/encoding/not-http-equiv-content-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/not-http-equiv-content.html24
-rw-r--r--LayoutTests/fast/encoding/parser-tests-expected.txt39
-rw-r--r--LayoutTests/fast/encoding/parser-tests.html67
-rw-r--r--LayoutTests/fast/encoding/quotes-in-title-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/quotes-in-title.html27
-rw-r--r--LayoutTests/fast/encoding/resources/001.html66
-rw-r--r--LayoutTests/fast/encoding/resources/002.html66
-rw-r--r--LayoutTests/fast/encoding/resources/003.html66
-rw-r--r--LayoutTests/fast/encoding/resources/004.html66
-rw-r--r--LayoutTests/fast/encoding/resources/005.html66
-rw-r--r--LayoutTests/fast/encoding/resources/006.html68
-rw-r--r--LayoutTests/fast/encoding/resources/007.html66
-rw-r--r--LayoutTests/fast/encoding/resources/008.html66
-rw-r--r--LayoutTests/fast/encoding/resources/009.html66
-rw-r--r--LayoutTests/fast/encoding/resources/010.html66
-rw-r--r--LayoutTests/fast/encoding/resources/011.html66
-rw-r--r--LayoutTests/fast/encoding/resources/012.html66
-rw-r--r--LayoutTests/fast/encoding/resources/013.html66
-rw-r--r--LayoutTests/fast/encoding/resources/014.html66
-rw-r--r--LayoutTests/fast/encoding/resources/015.html66
-rw-r--r--LayoutTests/fast/encoding/resources/016.html66
-rw-r--r--LayoutTests/fast/encoding/resources/017.html66
-rw-r--r--LayoutTests/fast/encoding/resources/018.html66
-rw-r--r--LayoutTests/fast/encoding/resources/019.html66
-rw-r--r--LayoutTests/fast/encoding/resources/020.html66
-rw-r--r--LayoutTests/fast/encoding/resources/021.html66
-rw-r--r--LayoutTests/fast/encoding/resources/022.html70
-rw-r--r--LayoutTests/fast/encoding/resources/023.html70
-rw-r--r--LayoutTests/fast/encoding/resources/024.html70
-rw-r--r--LayoutTests/fast/encoding/resources/025.html68
-rw-r--r--LayoutTests/fast/encoding/resources/026.html68
-rw-r--r--LayoutTests/fast/encoding/resources/027.html68
-rw-r--r--LayoutTests/fast/encoding/resources/028.html68
-rw-r--r--LayoutTests/fast/encoding/resources/029.html68
-rw-r--r--LayoutTests/fast/encoding/resources/030.html68
-rw-r--r--LayoutTests/fast/encoding/resources/031.html68
-rw-r--r--LayoutTests/fast/encoding/resources/032.html66
-rw-r--r--LayoutTests/fast/encoding/resources/033.html68
-rw-r--r--LayoutTests/fast/encoding/resources/034.html70
-rw-r--r--LayoutTests/fast/encoding/resources/035.html70
-rw-r--r--LayoutTests/fast/encoding/resources/036.html70
-rw-r--r--LayoutTests/fast/encoding/resources/037.html70
-rw-r--r--LayoutTests/fast/encoding/resources/038.html68
-rw-r--r--LayoutTests/fast/encoding/resources/039.html68
-rw-r--r--LayoutTests/fast/encoding/resources/040.html68
-rw-r--r--LayoutTests/fast/encoding/resources/041.html68
-rw-r--r--LayoutTests/fast/encoding/resources/042.html66
-rw-r--r--LayoutTests/fast/encoding/resources/043.html68
-rw-r--r--LayoutTests/fast/encoding/resources/044.html66
-rw-r--r--LayoutTests/fast/encoding/resources/045.html66
-rw-r--r--LayoutTests/fast/encoding/resources/046.html66
-rw-r--r--LayoutTests/fast/encoding/resources/047.html66
-rw-r--r--LayoutTests/fast/encoding/resources/048.html66
-rw-r--r--LayoutTests/fast/encoding/resources/049.html66
-rw-r--r--LayoutTests/fast/encoding/resources/050.html66
-rw-r--r--LayoutTests/fast/encoding/resources/051.html66
-rw-r--r--LayoutTests/fast/encoding/resources/052.html66
-rw-r--r--LayoutTests/fast/encoding/resources/053.html66
-rw-r--r--LayoutTests/fast/encoding/resources/054.html66
-rw-r--r--LayoutTests/fast/encoding/resources/055.html74
-rw-r--r--LayoutTests/fast/encoding/resources/056.html66
-rw-r--r--LayoutTests/fast/encoding/resources/057.html66
-rw-r--r--LayoutTests/fast/encoding/resources/058.html66
-rw-r--r--LayoutTests/fast/encoding/resources/059.html66
-rw-r--r--LayoutTests/fast/encoding/resources/060.html66
-rw-r--r--LayoutTests/fast/encoding/resources/061.html66
-rw-r--r--LayoutTests/fast/encoding/resources/062.html68
-rw-r--r--LayoutTests/fast/encoding/resources/063.html68
-rw-r--r--LayoutTests/fast/encoding/resources/064.html68
-rw-r--r--LayoutTests/fast/encoding/resources/065.html68
-rw-r--r--LayoutTests/fast/encoding/resources/066.html68
-rw-r--r--LayoutTests/fast/encoding/resources/067.html66
-rw-r--r--LayoutTests/fast/encoding/resources/068.html66
-rw-r--r--LayoutTests/fast/encoding/resources/069.html68
-rw-r--r--LayoutTests/fast/encoding/resources/070.html68
-rw-r--r--LayoutTests/fast/encoding/resources/071.html66
-rw-r--r--LayoutTests/fast/encoding/resources/072.html66
-rw-r--r--LayoutTests/fast/encoding/resources/073.html66
-rw-r--r--LayoutTests/fast/encoding/resources/074.html66
-rw-r--r--LayoutTests/fast/encoding/resources/075.html66
-rw-r--r--LayoutTests/fast/encoding/resources/076.html66
-rw-r--r--LayoutTests/fast/encoding/resources/077.html66
-rw-r--r--LayoutTests/fast/encoding/resources/078.html66
-rw-r--r--LayoutTests/fast/encoding/resources/079.html66
-rw-r--r--LayoutTests/fast/encoding/resources/080.html66
-rw-r--r--LayoutTests/fast/encoding/resources/081.html66
-rw-r--r--LayoutTests/fast/encoding/resources/082.html66
-rw-r--r--LayoutTests/fast/encoding/resources/083.html66
-rw-r--r--LayoutTests/fast/encoding/resources/084.html66
-rw-r--r--LayoutTests/fast/encoding/resources/085.html66
-rw-r--r--LayoutTests/fast/encoding/resources/086.html66
-rw-r--r--LayoutTests/fast/encoding/resources/087.html66
-rw-r--r--LayoutTests/fast/encoding/resources/088.html66
-rw-r--r--LayoutTests/fast/encoding/resources/089.html66
-rw-r--r--LayoutTests/fast/encoding/resources/090.html66
-rw-r--r--LayoutTests/fast/encoding/resources/091.html66
-rw-r--r--LayoutTests/fast/encoding/resources/092.html66
-rw-r--r--LayoutTests/fast/encoding/resources/093.html66
-rw-r--r--LayoutTests/fast/encoding/resources/094.html66
-rw-r--r--LayoutTests/fast/encoding/resources/095.html66
-rw-r--r--LayoutTests/fast/encoding/resources/096.html68
-rw-r--r--LayoutTests/fast/encoding/resources/097.html66
-rw-r--r--LayoutTests/fast/encoding/resources/098.html70
-rw-r--r--LayoutTests/fast/encoding/resources/099.html68
-rw-r--r--LayoutTests/fast/encoding/resources/100.html68
-rw-r--r--LayoutTests/fast/encoding/resources/101.html68
-rw-r--r--LayoutTests/fast/encoding/resources/102.html68
-rw-r--r--LayoutTests/fast/encoding/resources/103.html66
-rw-r--r--LayoutTests/fast/encoding/resources/104.html66
-rw-r--r--LayoutTests/fast/encoding/resources/105.html66
-rw-r--r--LayoutTests/fast/encoding/resources/106.html66
-rw-r--r--LayoutTests/fast/encoding/resources/107.html66
-rw-r--r--LayoutTests/fast/encoding/resources/108.html66
-rw-r--r--LayoutTests/fast/encoding/resources/109.html66
-rw-r--r--LayoutTests/fast/encoding/resources/110.html74
-rw-r--r--LayoutTests/fast/encoding/resources/111.html84
-rw-r--r--LayoutTests/fast/encoding/resources/112.html66
-rw-r--r--LayoutTests/fast/encoding/resources/113.html66
-rw-r--r--LayoutTests/fast/encoding/resources/114.html66
-rw-r--r--LayoutTests/fast/encoding/resources/115.html66
-rw-r--r--LayoutTests/fast/encoding/resources/116.html66
-rw-r--r--LayoutTests/fast/encoding/resources/117.html66
-rw-r--r--LayoutTests/fast/encoding/resources/118.html66
-rw-r--r--LayoutTests/fast/encoding/resources/119.html66
-rw-r--r--LayoutTests/fast/encoding/resources/120.html66
-rw-r--r--LayoutTests/fast/encoding/resources/121.html66
-rw-r--r--LayoutTests/fast/encoding/resources/122.html66
-rw-r--r--LayoutTests/fast/encoding/resources/123.html66
-rw-r--r--LayoutTests/fast/encoding/resources/char-decoding-utils.js18
-rw-r--r--LayoutTests/fast/encoding/tag-name-digit-expected.txt3
-rw-r--r--LayoutTests/fast/encoding/tag-name-digit.html26
-rw-r--r--LayoutTests/fast/js/resources/standalone-pre.js2
-rw-r--r--LayoutTests/fast/xpath/4XPath/Core/test.js1
-rw-r--r--LayoutTests/fast/xpath/ambiguous-operators-expected.txt73
-rw-r--r--LayoutTests/fast/xpath/ambiguous-operators.html118
-rw-r--r--LayoutTests/http/tests/resources/file-last-modified.php7
-rw-r--r--LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt8
-rw-r--r--LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt8
-rw-r--r--LayoutTests/storage/hash-change-with-xhr.js6
-rw-r--r--LayoutTests/storage/indexeddb/cursor-delete-expected.txt133
-rw-r--r--LayoutTests/storage/indexeddb/cursor-delete.html132
-rw-r--r--LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt134
-rw-r--r--LayoutTests/storage/indexeddb/cursor-index-delete.html136
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics-expected.txt31
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics.html45
-rw-r--r--LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt32
-rw-r--r--LayoutTests/storage/indexeddb/transaction-crash-on-abort.html44
-rw-r--r--LayoutTests/storage/private-browsing-noread-nowrite-expected.txt (renamed from LayoutTests/storage/private-browsing-readonly-expected.txt)2
-rw-r--r--LayoutTests/storage/private-browsing-noread-nowrite.html (renamed from LayoutTests/storage/private-browsing-readonly.html)5
173 files changed, 9564 insertions, 104 deletions
diff --git a/LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange-expected.txt b/LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange-expected.txt
deleted file mode 100644
index 0f0aac6..0000000
--- a/LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange-expected.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Tests that document.createEvent() works with orientationChange
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-FAIL... orientationChange event doesn't appear to be enabled or implemented.
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
-
-
-
diff --git a/LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange.html b/LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange.html
deleted file mode 100644
index 7a033e0..0000000
--- a/LayoutTests/fast/dom/DeviceOrientation/create-event-onorientationchange.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
-<head>
-<link rel="stylesheet" href="../../js/resources/js-test-style.css">
-<script src="../../js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></p>
-<div id="result"></div>
-<script src="script-tests/create-event-onorientationchange.js"></script>
-<script src="../../js/resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/DeviceOrientation/script-tests/create-event-onorientationchange.js b/LayoutTests/fast/dom/DeviceOrientation/script-tests/create-event-onorientationchange.js
deleted file mode 100644
index a63685b..0000000
--- a/LayoutTests/fast/dom/DeviceOrientation/script-tests/create-event-onorientationchange.js
+++ /dev/null
@@ -1,18 +0,0 @@
-description('Tests that document.createEvent() works with orientationChange')
-
-function handleOrientationChange()
-{
- document.getElementById('result').innerHTML = "PASS";
-}
-
-window.addEventListener('onorientationchange', handleOrientationChange, false);
-
-try {
- var event = document.createEvent("OrientationEvent");
- event.initEvent("orientationchange", false, false);
- window.dispatchEvent(event);
-} catch(e) {
- document.getElementById('result').innerHTML = "FAIL... orientationChange event doesn't appear to be enabled or implemented.";
-}
-
-window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
index cce57ce..10e28e6 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
@@ -23,7 +23,7 @@ function continueTest()
{
// Make another request, with permission already denied.
if (window.layoutTestController)
- layoutTestController.setMockGeolocationError(0, 'test');
+ layoutTestController.setMockGeolocationError(2, 'test');
navigator.geolocation.getCurrentPosition(function(p) {
testFailed('Success callback invoked unexpectedly');
diff --git a/LayoutTests/fast/encoding/bracket-in-script-expected.txt b/LayoutTests/fast/encoding/bracket-in-script-expected.txt
new file mode 100644
index 0000000..d5da37d
--- /dev/null
+++ b/LayoutTests/fast/encoding/bracket-in-script-expected.txt
@@ -0,0 +1,4 @@
+PASS: windows-1255
+This test checks that charset sniffer does not get confused by the left angle bracket that is not part of a tag. There was a bug where the less-than caused all text after it until the next closing bracket to be consumed as the tag, resulting in the closing script tag being missed by the charset sniffer.
+
+The charset sniffer would think it was still in the script mode and ignore the meta tag. This test relies on the charset sniffer ignoring meta tags inside script and checking at least 1024 bytes of data for a meta tag.
diff --git a/LayoutTests/fast/encoding/bracket-in-script.html b/LayoutTests/fast/encoding/bracket-in-script.html
new file mode 100644
index 0000000..0f923ed
--- /dev/null
+++ b/LayoutTests/fast/encoding/bracket-in-script.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<script>
+if (2 < 1) foo = bar;
+</script>
+</head>
+<body>
+<meta charset=windows-1255>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "windows-1255")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>This test checks that charset sniffer does not get confused by the left angle bracket that is not part of a tag. There was a bug where the less-than caused all text after it until the next closing bracket to be consumed as the tag, resulting in the closing script tag being missed by the charset sniffer.</p>
+<p>The charset sniffer would think it was still in the script mode and ignore the meta tag. This test relies on the charset sniffer ignoring meta tags inside script and checking at least 1024 bytes of data for a meta tag.</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/bracket-in-tag-expected.txt b/LayoutTests/fast/encoding/bracket-in-tag-expected.txt
new file mode 100644
index 0000000..689d1ec
--- /dev/null
+++ b/LayoutTests/fast/encoding/bracket-in-tag-expected.txt
@@ -0,0 +1,2 @@
+ 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.
diff --git a/LayoutTests/fast/encoding/bracket-in-tag.html b/LayoutTests/fast/encoding/bracket-in-tag.html
new file mode 100644
index 0000000..36862e4
--- /dev/null
+++ b/LayoutTests/fast/encoding/bracket-in-tag.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<foo<meta charset=windows-1255>
+</head>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "windows-1255")
+ log("FAIL: " + document.inputEncoding);
+else
+ log("PASS: " + document.inputEncoding);
+</script>
+<p>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.
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/char-decoding-expected.txt b/LayoutTests/fast/encoding/char-decoding-expected.txt
index 26afe48..4eaf6c0 100644
--- a/LayoutTests/fast/encoding/char-decoding-expected.txt
+++ b/LayoutTests/fast/encoding/char-decoding-expected.txt
@@ -155,8 +155,17 @@ PASS decode('dos-874', '%96') is 'U+2013'
PASS decode('dos-874', '%A0') is 'U+00A0'
PASS decode('dos-874', '%A1') is 'U+0E01'
PASS decode('dos-874', '%DB') is 'U+F8C1'
-PASS decode('UTF-7', '+AD4') is 'U+002B'
-PASS decode('utf-7', '+AD4') is 'U+002B'
+PASS decode('UTF-7', '+AD4') is 'U+002B/U+0041/U+0044/U+0034'
+PASS decode('utf-7', '+AD4') is 'U+002B/U+0041/U+0044/U+0034'
+PASS decode('UTF-16LE', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('unicodeFEFF', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('UTF-16', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('ISO-10646-UCS-2', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('UCS-2', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('Unicode', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('csUnicode', '%69%D8%D6%DE') is 'U+D869/U+DED6'
+PASS decode('UTF-16BE', '%D8%69%DE%D6') is 'U+D869/U+DED6'
+PASS decode('unicodeFFFE', '%D8%69%DE%D6') is 'U+D869/U+DED6'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/encoding/char-decoding.html b/LayoutTests/fast/encoding/char-decoding.html
index b913389..d681170 100644
--- a/LayoutTests/fast/encoding/char-decoding.html
+++ b/LayoutTests/fast/encoding/char-decoding.html
@@ -89,9 +89,23 @@ batchTestDecode(thai);
// UTF-7 is expressly forbidden, so decoding it should not work correctly.
// This attempts to decode '<' as UTF-7 (+AD4) but it ends up being decoded
-// as a '+'.
-testDecode('UTF-7', '+AD4', 'U+002B');
-testDecode('utf-7', '+AD4', 'U+002B');
+// as a '+AD4'.
+testDecode('UTF-7', '+AD4', 'U+002B/U+0041/U+0044/U+0034');
+testDecode('utf-7', '+AD4', 'U+002B/U+0041/U+0044/U+0034');
+
+// UTF-16LE and variants.
+testDecode('UTF-16LE', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('unicodeFEFF', '%69%D8%D6%DE', 'U+D869/U+DED6');
+// According to HTML5 and for IE compatibility, UTF-16 is treated as little endian. The following tests fail as of Firefox 3.6.13.
+testDecode('UTF-16', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('ISO-10646-UCS-2', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('UCS-2', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('Unicode', '%69%D8%D6%DE', 'U+D869/U+DED6');
+testDecode('csUnicode', '%69%D8%D6%DE', 'U+D869/U+DED6');
+
+// UTF-16BE and variants.
+testDecode('UTF-16BE', '%D8%69%DE%D6', 'U+D869/U+DED6');
+testDecode('unicodeFFFE', '%D8%69%DE%D6', 'U+D869/U+DED6');
successfullyParsed = true;
diff --git a/LayoutTests/fast/encoding/escaped-bracket-expected.txt b/LayoutTests/fast/encoding/escaped-bracket-expected.txt
new file mode 100644
index 0000000..faf6564
--- /dev/null
+++ b/LayoutTests/fast/encoding/escaped-bracket-expected.txt
@@ -0,0 +1,2 @@
+PASS: KOI8-R
+This test checks whether charset sniffer skips over escaped characters correctly.
diff --git a/LayoutTests/fast/encoding/escaped-bracket.html b/LayoutTests/fast/encoding/escaped-bracket.html
new file mode 100644
index 0000000..0566d0d
--- /dev/null
+++ b/LayoutTests/fast/encoding/escaped-bracket.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+<title>
+foo="\</title\>"
+<meta charset=windows-1255>
+</title>
+<meta charset=KOI8-R>
+</head>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "KOI8-R")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>
+This test checks whether charset sniffer skips over escaped characters correctly.
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/meta-in-body-expected.txt b/LayoutTests/fast/encoding/meta-in-body-expected.txt
new file mode 100644
index 0000000..2996f64
--- /dev/null
+++ b/LayoutTests/fast/encoding/meta-in-body-expected.txt
@@ -0,0 +1,2 @@
+PASS: ISO-2022-JP
+This test checks that the charset sniffer scans at least 1024 bytes of data to find a meta tag, even if it is not in the head section.
diff --git a/LayoutTests/fast/encoding/meta-in-body.html b/LayoutTests/fast/encoding/meta-in-body.html
new file mode 100644
index 0000000..f66097c
--- /dev/null
+++ b/LayoutTests/fast/encoding/meta-in-body.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+</head>
+<body>
+<meta charset=ISO-2022-JP>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "ISO-2022-JP")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>
+This test checks that the charset sniffer scans at least 1024 bytes of data to find a meta tag, even if it is not in the head section.
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/meta-in-script-expected.txt b/LayoutTests/fast/encoding/meta-in-script-expected.txt
new file mode 100644
index 0000000..ab9fb78
--- /dev/null
+++ b/LayoutTests/fast/encoding/meta-in-script-expected.txt
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: line 4: SyntaxError: Parse error
+PASS: windows-1255
+This test passes if the charset is parsed from the meta tag outside the script.
diff --git a/LayoutTests/fast/encoding/meta-in-script.html b/LayoutTests/fast/encoding/meta-in-script.html
new file mode 100644
index 0000000..523788f
--- /dev/null
+++ b/LayoutTests/fast/encoding/meta-in-script.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+<script>
+<meta charset=koi8-r>
+</script>
+<meta charset=windows-1255>
+</head>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "windows-1255")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>This test passes if the charset is parsed from the meta tag outside the script.
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/meta-in-title-expected.txt b/LayoutTests/fast/encoding/meta-in-title-expected.txt
new file mode 100644
index 0000000..5322e7b
--- /dev/null
+++ b/LayoutTests/fast/encoding/meta-in-title-expected.txt
@@ -0,0 +1,2 @@
+PASS: KOI8-R
+This test verifies that charset sniffer ignores meta tag in a title.
diff --git a/LayoutTests/fast/encoding/meta-in-title.html b/LayoutTests/fast/encoding/meta-in-title.html
new file mode 100644
index 0000000..ce07e51
--- /dev/null
+++ b/LayoutTests/fast/encoding/meta-in-title.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<title>
+<meta charset=windows-1255>
+</title>
+<meta charset=KOI8-R>
+</head>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "KOI8-R")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>
+This test verifies that charset sniffer ignores meta tag in a title.
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/mismatched-end-tag-expected.txt b/LayoutTests/fast/encoding/mismatched-end-tag-expected.txt
new file mode 100644
index 0000000..760606b
--- /dev/null
+++ b/LayoutTests/fast/encoding/mismatched-end-tag-expected.txt
@@ -0,0 +1,2 @@
+PASS: windows-1255
+This test checks that charset sniffer does not get confused by the extraneous end script tag and ignore the meta tag, thinking it is inside a script.
diff --git a/LayoutTests/fast/encoding/mismatched-end-tag.html b/LayoutTests/fast/encoding/mismatched-end-tag.html
new file mode 100644
index 0000000..2b738c4
--- /dev/null
+++ b/LayoutTests/fast/encoding/mismatched-end-tag.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+</script>
+<meta charset=windows-1255>
+</head>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "windows-1255")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>This test checks that charset sniffer does not get confused by the extraneous end script tag and ignore the meta tag, thinking it is inside a script.</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/namespace-meta-expected.txt b/LayoutTests/fast/encoding/namespace-meta-expected.txt
new file mode 100644
index 0000000..23b9916
--- /dev/null
+++ b/LayoutTests/fast/encoding/namespace-meta-expected.txt
@@ -0,0 +1,3 @@
+This test checks that the charset sniffer ignores namespaced meta tags.
+PASS: ISO-2022-JP
+
diff --git a/LayoutTests/fast/encoding/namespace-meta.html b/LayoutTests/fast/encoding/namespace-meta.html
new file mode 100644
index 0000000..e994438
--- /dev/null
+++ b/LayoutTests/fast/encoding/namespace-meta.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<testme:meta charset=windows-1252>
+<meta charset=ISO-2022-JP>
+</head>
+<body>
+This test checks that the charset sniffer ignores namespaced meta tags.
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "ISO-2022-JP")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/namespace-tolerance.html b/LayoutTests/fast/encoding/namespace-tolerance.html
index c7841d2..7c3692d 100644
--- a/LayoutTests/fast/encoding/namespace-tolerance.html
+++ b/LayoutTests/fast/encoding/namespace-tolerance.html
@@ -1,5 +1,5 @@
<xhtml:html xmlns:xhtml="">
-<meta content="charset=UTF-8">
+<meta content="charset=UTF-8" http-equiv="Content-Type">
This test ensures a UTF-8 encoding is properly set on documents that:
<br>
diff --git a/LayoutTests/fast/encoding/not-http-equiv-content-expected.txt b/LayoutTests/fast/encoding/not-http-equiv-content-expected.txt
new file mode 100644
index 0000000..7740144
--- /dev/null
+++ b/LayoutTests/fast/encoding/not-http-equiv-content-expected.txt
@@ -0,0 +1,2 @@
+PASS: windows-1255
+This test checks that charset sniffer does not get confused by the text that contains charset wording.
diff --git a/LayoutTests/fast/encoding/not-http-equiv-content.html b/LayoutTests/fast/encoding/not-http-equiv-content.html
new file mode 100644
index 0000000..dcc1476
--- /dev/null
+++ b/LayoutTests/fast/encoding/not-http-equiv-content.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta name="description" content="how to set charset=utf-8 on HTML docs">
+<meta http-equiv="content-type" content="text/html; charset=windows-1255">
+</head>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "windows-1255")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>This test checks that charset sniffer does not get confused by the text that contains charset wording.</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/parser-tests-expected.txt b/LayoutTests/fast/encoding/parser-tests-expected.txt
new file mode 100644
index 0000000..fb15ae2
--- /dev/null
+++ b/LayoutTests/fast/encoding/parser-tests-expected.txt
@@ -0,0 +1,39 @@
+This test suite was converted from http://www.hixie.ch/tests/adhoc/html/parsing/encoding/all.html
+
+Expected failures:
+56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
+60 - parser treats meta inside style as text, not a tag.
+97, 99, 102 - we do not run scripts during encoding detection.
+Status: Tests ran.
+
+Serious failures:
+
+test 056: expected Windows-1254; used Windows-1252
+<!DOCTYPE HTML>
+<script>document.write('<meta charset="ISO-8859-' + '9">')</script>
+test 057: expected Windows-1254; used Windows-1252
+<!DOCTYPE HTML>
+<script>var s = '9">'; document.write('<meta charset="ISO-8859-' + s)</script>
+test 058: expected Windows-1254; used Windows-1252
+<!DOCTYPE HTML>
+<script>document.write('<meta charset="ISO-8859-9">')</script>
+test 059: expected Windows-1254; used Windows-1252
+<!DOCTYPE HTML>
+<script type="text/plain"><meta charset="ISO-8859-9"></script>
+test 060: expected Windows-1254; used Windows-1252
+<!DOCTYPE HTML>
+<style type="text/plain"><meta charset="ISO-8859-9"></style>
+test 097: expected Windows-1254; used Windows-1252
+<!DOCTYPE HTML>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))</script>
+test 099: expected Windows-1252; used Windows-1254
+<!DOCTYPE HTML>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))</script>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9">
+test 102: expected Windows-1254; used Windows-1252
+<!DOCTYPE HTML>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))</script>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))</script>
+(Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
+
+
diff --git a/LayoutTests/fast/encoding/parser-tests.html b/LayoutTests/fast/encoding/parser-tests.html
new file mode 100644
index 0000000..fead50a
--- /dev/null
+++ b/LayoutTests/fast/encoding/parser-tests.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Harness</title>
+ </head>
+ <body onload="runtests()">
+ <p>This test suite was converted from http://www.hixie.ch/tests/adhoc/html/parsing/encoding/all.html</p>
+ <ul>Expected failures:
+ <li>56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.</li>
+ <li>60 - parser treats meta inside style as text, not a tag.</li>
+ <li>97, 99, 102 - we do not run scripts during encoding detection.</li>
+ </ul>
+ <p>Status: <span id="status">Tests did not run.</span></p>
+ <p>Serious failures:</p>
+ <ol id="failures">
+ </ol>
+ <p>(Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)</p>
+ <p><iframe id="test"></iframe></p>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ var frame = document.getElementById('test');
+ var current = 1;
+ var max = 123;
+ function dotest() {
+ var s = current + '';
+ while (s.length < 3) s = '0' + s;
+ frame.src = 'resources/' + s + '.html';
+ window.receivedResults = function () {
+ var want = frame.contentWindow.document.getElementById('expected').firstChild.data;
+ var have = frame.contentWindow.document.getElementById('encoding').firstChild.data;
+ if (have == 'ISO-8859-9')
+ have = 'Windows-1254';
+ if (want != have) {
+ var li = document.createElement('li');
+ var a = document.createElement('a');
+ a.appendChild(document.createTextNode('test ' + s));
+ a.href = s + '.html';
+ li.appendChild(a);
+ li.appendChild(document.createTextNode(': expected ' + want + '; used ' + have));
+ var pre = document.createElement('pre');
+ pre.appendChild(document.createTextNode(frame.contentWindow.document.getElementsByTagName('pre')[0].firstChild.data));
+ li.appendChild(pre);
+ li.value = current;
+ document.getElementById('failures').appendChild(li);
+ }
+ current += 1;
+ if (current <= max)
+ dotest();
+ else {
+ frame.parentNode.removeChild(frame);
+ document.getElementById('status').innerText = "Tests ran.";
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ };
+ }
+ function runtests() {
+ dotest();
+ }
+ function alert() { }
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/fast/encoding/quotes-in-title-expected.txt b/LayoutTests/fast/encoding/quotes-in-title-expected.txt
new file mode 100644
index 0000000..c430b7f
--- /dev/null
+++ b/LayoutTests/fast/encoding/quotes-in-title-expected.txt
@@ -0,0 +1,2 @@
+PASS: KOI8-R
+This test checks whether charset sniffer skips over quoted elements in a title tag correctly. Tests a bug in the charset sniffer that would consume all characters after the bracket in the quoted text until the next closing bracket, causing the closing title tag to be missed.
diff --git a/LayoutTests/fast/encoding/quotes-in-title.html b/LayoutTests/fast/encoding/quotes-in-title.html
new file mode 100644
index 0000000..117525b
--- /dev/null
+++ b/LayoutTests/fast/encoding/quotes-in-title.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<title>
+foo="<a"
+</title>
+<meta charset=KOI8-R>
+</head>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "KOI8-R")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>
+This test checks whether charset sniffer skips over quoted elements in a title tag correctly. Tests a bug in the charset sniffer that would consume all characters after the bracket in the quoted text until the next closing bracket, causing the closing title tag to be missed.
+</body>
+</html>
diff --git a/LayoutTests/fast/encoding/resources/001.html b/LayoutTests/fast/encoding/resources/001.html
new file mode 100644
index 0000000..cbd5646
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/001.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<!-- (control test - for the other tests to work, this should pass - you may have to set your defaults appropriately) -->
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;!-- (control test - for the other tests to work, this should pass - you may have to set your defaults appropriately) --></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/002.html b/LayoutTests/fast/encoding/resources/002.html
new file mode 100644
index 0000000..ae24214
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/002.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-1">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="ISO-8859-1"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/003.html b/LayoutTests/fast/encoding/resources/003.html
new file mode 100644
index 0000000..83b47eb
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/003.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/004.html b/LayoutTests/fast/encoding/resources/004.html
new file mode 100644
index 0000000..28c00c9
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/004.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta charset='ISO-8859-9'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset='ISO-8859-9'></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/005.html b/LayoutTests/fast/encoding/resources/005.html
new file mode 100644
index 0000000..af4e682
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/005.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta charset=ISO-8859-9>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset=ISO-8859-9></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/006.html b/LayoutTests/fast/encoding/resources/006.html
new file mode 100644
index 0000000..92ac336
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/006.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta
+charset=ISO-8859-9>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta
+charset=ISO-8859-9></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/007.html b/LayoutTests/fast/encoding/resources/007.html
new file mode 100644
index 0000000..92e7130
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/007.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<metacharset=ISO-8859-9>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;metacharset=ISO-8859-9></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/008.html b/LayoutTests/fast/encoding/resources/008.html
new file mode 100644
index 0000000..076a3c9
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/008.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/009.html b/LayoutTests/fast/encoding/resources/009.html
new file mode 100644
index 0000000..482e33d
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/009.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Type">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Type"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/010.html b/LayoutTests/fast/encoding/resources/010.html
new file mode 100644
index 0000000..ce0b0ee
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/010.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content=text/html; charset=ISO-8859-9>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content=text/html; charset=ISO-8859-9></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/011.html b/LayoutTests/fast/encoding/resources/011.html
new file mode 100644
index 0000000..46aea57
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/011.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type content="text/html; charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type content="text/html; charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/012.html b/LayoutTests/fast/encoding/resources/012.html
new file mode 100644
index 0000000..49fbac1
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/012.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type " content="text/html; charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type " content="text/html; charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/013.html b/LayoutTests/fast/encoding/resources/013.html
new file mode 100644
index 0000000..39cc3ed
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/013.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Type ">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Type "></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/014.html b/LayoutTests/fast/encoding/resources/014.html
new file mode 100644
index 0000000..26954c1
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/014.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type>" content="text/html; charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type>" content="text/html; charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/015.html b/LayoutTests/fast/encoding/resources/015.html
new file mode 100644
index 0000000..17d3222
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/015.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Type>">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Type>"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/016.html b/LayoutTests/fast/encoding/resources/016.html
new file mode 100644
index 0000000..885da5a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/016.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Style-Type" content="text/html; charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Style-Type" content="text/html; charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/017.html b/LayoutTests/fast/encoding/resources/017.html
new file mode 100644
index 0000000..ac908cb
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/017.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Style-Type">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html; charset=ISO-8859-9" http-equiv="Content-Style-Type"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/018.html b/LayoutTests/fast/encoding/resources/018.html
new file mode 100644
index 0000000..4da5001
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/018.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta name="Content-Style-Type" content="text/html; charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta name="Content-Style-Type" content="text/html; charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/019.html b/LayoutTests/fast/encoding/resources/019.html
new file mode 100644
index 0000000..687d24f
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/019.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content="text/html; charset=ISO-8859-9" name="Content-Style-Type">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html; charset=ISO-8859-9" name="Content-Style-Type"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/020.html b/LayoutTests/fast/encoding/resources/020.html
new file mode 100644
index 0000000..0c3a15b
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/020.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content="text/html; charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html; charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/021.html b/LayoutTests/fast/encoding/resources/021.html
new file mode 100644
index 0000000..4f0bd5a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/021.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content=" text/html; charset = ISO-8859-9 ">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content=" text/html; charset = ISO-8859-9 "></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/022.html b/LayoutTests/fast/encoding/resources/022.html
new file mode 100644
index 0000000..9c7d101
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/022.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<meta content="
+text/html; charset=ISO-8859-9
+">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="
+text/html; charset=ISO-8859-9
+"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/023.html b/LayoutTests/fast/encoding/resources/023.html
new file mode 100644
index 0000000..902833f
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/023.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<meta charset="
+ISO-8859-9
+">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="
+ISO-8859-9
+"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/024.html b/LayoutTests/fast/encoding/resources/024.html
new file mode 100644
index 0000000..5c1a2b0
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/024.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<meta charset=
+ISO-8859-9
+>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset=
+ISO-8859-9
+></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/025.html b/LayoutTests/fast/encoding/resources/025.html
new file mode 100644
index 0000000..8430d0e
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/025.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/026.html b/LayoutTests/fast/encoding/resources/026.html
new file mode 100644
index 0000000..590236d
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/026.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta charset=ISO-8859-9">
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset=ISO-8859-9">
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/027.html b/LayoutTests/fast/encoding/resources/027.html
new file mode 100644
index 0000000..9833c1a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/027.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta " charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta " charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/028.html b/LayoutTests/fast/encoding/resources/028.html
new file mode 100644
index 0000000..5dac790
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/028.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta test" charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta test" charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/029.html b/LayoutTests/fast/encoding/resources/029.html
new file mode 100644
index 0000000..e7dd125
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/029.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta test=" charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta test=" charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/030.html b/LayoutTests/fast/encoding/resources/030.html
new file mode 100644
index 0000000..c747340
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/030.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta test="' charset=ISO-8859-9>
+<p>"'</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta test="' charset=ISO-8859-9>
+&lt;p>"'&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/031.html b/LayoutTests/fast/encoding/resources/031.html
new file mode 100644
index 0000000..4bebc5f
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/031.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta test='" charset=ISO-8859-9>
+<p>'"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta test='" charset=ISO-8859-9>
+&lt;p>'"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/032.html b/LayoutTests/fast/encoding/resources/032.html
new file mode 100644
index 0000000..2c72136
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/032.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta test="" charset=ISO-8859-9>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta test="" charset=ISO-8859-9></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/033.html b/LayoutTests/fast/encoding/resources/033.html
new file mode 100644
index 0000000..575e259
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/033.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta test=x" charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta test=x" charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/034.html b/LayoutTests/fast/encoding/resources/034.html
new file mode 100644
index 0000000..7b63622
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/034.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<head></head><p title="x>
+<meta test=x" charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;head>&lt;/head>&lt;p title="x>
+&lt;meta test=x" charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/035.html b/LayoutTests/fast/encoding/resources/035.html
new file mode 100644
index 0000000..bf5c398
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/035.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<head></head><p title="x>
+<meta test=x charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;head>&lt;/head>&lt;p title="x>
+&lt;meta test=x charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/036.html b/LayoutTests/fast/encoding/resources/036.html
new file mode 100644
index 0000000..c78d361
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/036.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<head></head><p title="x>
+<meta charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;head>&lt;/head>&lt;p title="x>
+&lt;meta charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/037.html b/LayoutTests/fast/encoding/resources/037.html
new file mode 100644
index 0000000..a30dc05
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/037.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<head></head><p title="x>">
+<meta charset=ISO-8859-9>
+<p>"</p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;head>&lt;/head>&lt;p title="x>">
+&lt;meta charset=ISO-8859-9>
+&lt;p>"&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/038.html b/LayoutTests/fast/encoding/resources/038.html
new file mode 100644
index 0000000..6e914d8
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/038.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-1">
+<meta charset="ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="ISO-8859-1">
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/039.html b/LayoutTests/fast/encoding/resources/039.html
new file mode 100644
index 0000000..4778b94
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/039.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-9">
+<meta charset="ISO-8859-1">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="ISO-8859-9">
+&lt;meta charset="ISO-8859-1"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/040.html b/LayoutTests/fast/encoding/resources/040.html
new file mode 100644
index 0000000..b34871f
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/040.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<!--<meta charset="ISO-8859-1">-->
+<meta charset="ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;!--&lt;meta charset="ISO-8859-1">-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/041.html b/LayoutTests/fast/encoding/resources/041.html
new file mode 100644
index 0000000..775987b
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/041.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<!--<meta charset="ISO-8859-9">-->
+<meta charset="ISO-8859-1">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;!--&lt;meta charset="ISO-8859-9">-->
+&lt;meta charset="ISO-8859-1"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/042.html b/LayoutTests/fast/encoding/resources/042.html
new file mode 100644
index 0000000..981da43
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/042.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<!-- Starts with UTF-8 BOM -->
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;!-- Starts with UTF-8 BOM --></pre>
+<p>Expected result: <span id="expected">UTF-8</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/043.html b/LayoutTests/fast/encoding/resources/043.html
new file mode 100644
index 0000000..02d655b
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/043.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-1">
+<!-- Starts with UTF-8 BOM -->
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="ISO-8859-1">
+&lt;!-- Starts with UTF-8 BOM --></pre>
+<p>Expected result: <span id="expected">UTF-8</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/044.html b/LayoutTests/fast/encoding/resources/044.html
new file mode 100644
index 0000000..e459d9b
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/044.html
@@ -0,0 +1,66 @@
+<!-- 511 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
+<meta charset="ISO-8859-9">
+<p>Test:
+<pre>&lt;!-- 511 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/045.html b/LayoutTests/fast/encoding/resources/045.html
new file mode 100644
index 0000000..b2bdd5a
--- /dev/null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
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/046.html b/LayoutTests/fast/encoding/resources/046.html
new file mode 100644
index 0000000..96c60ce
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/046.html
@@ -0,0 +1,66 @@
+<!-- 513 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz-->
+<meta charset="ISO-8859-9">
+<p>Test:
+<pre>&lt;!-- 513 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/047.html b/LayoutTests/fast/encoding/resources/047.html
new file mode 100644
index 0000000..3ff31a7
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/047.html
@@ -0,0 +1,66 @@
+<!-- 1024 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/048.html b/LayoutTests/fast/encoding/resources/048.html
new file mode 100644
index 0000000..b91a7d4
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/048.html
@@ -0,0 +1,66 @@
+<!-- 1025 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/049.html b/LayoutTests/fast/encoding/resources/049.html
new file mode 100644
index 0000000..82044c7
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/049.html
@@ -0,0 +1,66 @@
+<!-- 2048 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/050.html b/LayoutTests/fast/encoding/resources/050.html
new file mode 100644
index 0000000..b43973d
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/050.html
@@ -0,0 +1,66 @@
+<!-- 2049 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/051.html b/LayoutTests/fast/encoding/resources/051.html
new file mode 100644
index 0000000..c50fb37
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/051.html
@@ -0,0 +1,66 @@
+<!-- 4096 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/052.html b/LayoutTests/fast/encoding/resources/052.html
new file mode 100644
index 0000000..4375a95
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/052.html
@@ -0,0 +1,66 @@
+<!-- 4097 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/053.html b/LayoutTests/fast/encoding/resources/053.html
new file mode 100644
index 0000000..1eca9c8
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/053.html
@@ -0,0 +1,66 @@
+<!-- 8192 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/054.html b/LayoutTests/fast/encoding/resources/054.html
new file mode 100644
index 0000000..2e470a2
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/054.html
@@ -0,0 +1,66 @@
+<!-- 8193 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz-->
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/055.html b/LayoutTests/fast/encoding/resources/055.html
new file mode 100644
index 0000000..4e05762
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/055.html
@@ -0,0 +1,74 @@
+<!-- multi-script test -->
+<script>parent.alert('step 1 of 3 ("þ")')</script>
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<script>parent.alert('step 2 of 3 ("þ")')</script>
+<meta charset="ISO-8859-9">
+<script>parent.alert('step 3 of 3 ("þ")')</script>
+<p>Test:
+<pre>&lt;!-- multi-script test -->
+&lt;script>parent.alert('step 1 of 3 ("þ")')&lt;/script>
+&lt;!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+&lt;script>parent.alert('step 2 of 3 ("þ")')&lt;/script>
+&lt;meta charset="ISO-8859-9">
+&lt;script>parent.alert('step 3 of 3 ("þ")')&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/056.html b/LayoutTests/fast/encoding/resources/056.html
new file mode 100644
index 0000000..b4772b7
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/056.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<script>document.write('<meta charset="ISO-8859-' + '9">')</script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script>document.write('&lt;meta charset="ISO-8859-' + '9">')&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/057.html b/LayoutTests/fast/encoding/resources/057.html
new file mode 100644
index 0000000..9c78ab0
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/057.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<script>var s = '9">'; document.write('<meta charset="ISO-8859-' + s)</script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script>var s = '9">'; document.write('&lt;meta charset="ISO-8859-' + s)&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/058.html b/LayoutTests/fast/encoding/resources/058.html
new file mode 100644
index 0000000..d63c90e
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/058.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<script>document.write('<meta charset="ISO-8859-9">')</script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script>document.write('&lt;meta charset="ISO-8859-9">')&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/059.html b/LayoutTests/fast/encoding/resources/059.html
new file mode 100644
index 0000000..be8d1e6
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/059.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<script type="text/plain"><meta charset="ISO-8859-9"></script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script type="text/plain">&lt;meta charset="ISO-8859-9">&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/060.html b/LayoutTests/fast/encoding/resources/060.html
new file mode 100644
index 0000000..30dfb79
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/060.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<style type="text/plain"><meta charset="ISO-8859-9"></style>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;style type="text/plain">&lt;meta charset="ISO-8859-9">&lt;/style></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/061.html b/LayoutTests/fast/encoding/resources/061.html
new file mode 100644
index 0000000..b3b6e4a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/061.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<p><meta charset="ISO-8859-9"></p>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;p>&lt;meta charset="ISO-8859-9">&lt;/p></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/062.html b/LayoutTests/fast/encoding/resources/062.html
new file mode 100644
index 0000000..07e2b7a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/062.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta charset="bogus">
+<meta charset="ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="bogus">
+&lt;meta charset="ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/063.html b/LayoutTests/fast/encoding/resources/063.html
new file mode 100644
index 0000000..b1e3e5f
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/063.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<script type="text/plain"><meta charset="ISO-8859-9"></script>
+<meta charset="ISO-8859-1">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script type="text/plain">&lt;meta charset="ISO-8859-9">&lt;/script>
+&lt;meta charset="ISO-8859-1"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/064.html b/LayoutTests/fast/encoding/resources/064.html
new file mode 100644
index 0000000..19fc171
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/064.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<style type="text/plain"><meta charset="ISO-8859-9"></style>
+<meta charset="ISO-8859-1">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;style type="text/plain">&lt;meta charset="ISO-8859-9">&lt;/style>
+&lt;meta charset="ISO-8859-1"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/065.html b/LayoutTests/fast/encoding/resources/065.html
new file mode 100644
index 0000000..c0fe2d2
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/065.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta charset="
+ISO-8859-9 ">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset="
+ISO-8859-9 "></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/066.html b/LayoutTests/fast/encoding/resources/066.html
new file mode 100644
index 0000000..b3b24c9
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/066.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta content="text/html;charset='
+ISO-8859-9 '">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html;charset='
+ISO-8859-9 '"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/067.html b/LayoutTests/fast/encoding/resources/067.html
new file mode 100644
index 0000000..0ef69dc
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/067.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta charset=" ISO-8859-9 ">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta charset=" ISO-8859-9 "></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/068.html b/LayoutTests/fast/encoding/resources/068.html
new file mode 100644
index 0000000..1d20faa
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/068.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content="text/html;charset=' ISO-8859-9 '">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="text/html;charset=' ISO-8859-9 '"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/069.html b/LayoutTests/fast/encoding/resources/069.html
new file mode 100644
index 0000000..8cff55a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/069.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" charset="
+ISO-8859-9 ">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" charset="
+ISO-8859-9 "></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/070.html b/LayoutTests/fast/encoding/resources/070.html
new file mode 100644
index 0000000..a9cc860
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/070.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset='
+ISO-8859-9 '">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset='
+ISO-8859-9 '"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/071.html b/LayoutTests/fast/encoding/resources/071.html
new file mode 100644
index 0000000..cad0a0a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/071.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" charset=" ISO-8859-9 ">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" charset=" ISO-8859-9 "></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/072.html b/LayoutTests/fast/encoding/resources/072.html
new file mode 100644
index 0000000..60b64a5
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/072.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=' ISO-8859-9 '">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=' ISO-8859-9 '"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/073.html b/LayoutTests/fast/encoding/resources/073.html
new file mode 100644
index 0000000..187918a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/073.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset='ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset='ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/074.html b/LayoutTests/fast/encoding/resources/074.html
new file mode 100644
index 0000000..2a89ae5
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/074.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=&quot;ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=&amp;quot;ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/075.html b/LayoutTests/fast/encoding/resources/075.html
new file mode 100644
index 0000000..444b9e6
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/075.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset='ISO-8859-9'">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset='ISO-8859-9'"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/076.html b/LayoutTests/fast/encoding/resources/076.html
new file mode 100644
index 0000000..b01a21b
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/076.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=&quot;ISO-8859-9&quot;">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=&amp;quot;ISO-8859-9&amp;quot;"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/077.html b/LayoutTests/fast/encoding/resources/077.html
new file mode 100644
index 0000000..549162e
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/077.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset='ISO-8859-9';">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset='ISO-8859-9';"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/078.html b/LayoutTests/fast/encoding/resources/078.html
new file mode 100644
index 0000000..09e7ff6
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/078.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=&quot;ISO-8859-9&quot;;">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=&amp;quot;ISO-8859-9&amp;quot;;"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/079.html b/LayoutTests/fast/encoding/resources/079.html
new file mode 100644
index 0000000..4638f84
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/079.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9;">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9;"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/080.html b/LayoutTests/fast/encoding/resources/080.html
new file mode 100644
index 0000000..6c75a01
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/080.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9 x">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9 x"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/081.html b/LayoutTests/fast/encoding/resources/081.html
new file mode 100644
index 0000000..71da96f
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/081.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9x">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9x"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/082.html b/LayoutTests/fast/encoding/resources/082.html
new file mode 100644
index 0000000..db73b67
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/082.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charsetx=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charsetx=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/083.html b/LayoutTests/fast/encoding/resources/083.html
new file mode 100644
index 0000000..7ab94bd
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/083.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset:ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset:ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/084.html b/LayoutTests/fast/encoding/resources/084.html
new file mode 100644
index 0000000..5f1256a
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/084.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charsetx=ISO-8859-3;charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charsetx=ISO-8859-3;charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/085.html b/LayoutTests/fast/encoding/resources/085.html
new file mode 100644
index 0000000..e323934
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/085.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML;CHARSET=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML;CHARSET=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/086.html b/LayoutTests/fast/encoding/resources/086.html
new file mode 100644
index 0000000..bcfbe59
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/086.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/087.html b/LayoutTests/fast/encoding/resources/087.html
new file mode 100644
index 0000000..b84cf08
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/087.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html charset ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html charset ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/088.html b/LayoutTests/fast/encoding/resources/088.html
new file mode 100644
index 0000000..0939b1e
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/088.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html charset = ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html charset = ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/089.html b/LayoutTests/fast/encoding/resources/089.html
new file mode 100644
index 0000000..ec37fea
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/089.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html charset = 'ISO-8859-9'">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html charset = 'ISO-8859-9'"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/090.html b/LayoutTests/fast/encoding/resources/090.html
new file mode 100644
index 0000000..dd2af80
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/090.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;xcharset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;xcharset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/091.html b/LayoutTests/fast/encoding/resources/091.html
new file mode 100644
index 0000000..dfcc13b
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/091.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;x charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;x charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/092.html b/LayoutTests/fast/encoding/resources/092.html
new file mode 100644
index 0000000..027b28b
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/092.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html x charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html x charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/093.html b/LayoutTests/fast/encoding/resources/093.html
new file mode 100644
index 0000000..b3c2e67
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/093.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charsetcharset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charsetcharset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/094.html b/LayoutTests/fast/encoding/resources/094.html
new file mode 100644
index 0000000..ff47bac
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/094.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charsetxcharset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charsetxcharset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/095.html b/LayoutTests/fast/encoding/resources/095.html
new file mode 100644
index 0000000..d75e931
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/095.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charsetxxcharset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charsetxxcharset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/096.html b/LayoutTests/fast/encoding/resources/096.html
new file mode 100644
index 0000000..3118236
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/096.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9">
+<!-- control for next test -->
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9">
+&lt;!-- control for next test --></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/097.html b/LayoutTests/fast/encoding/resources/097.html
new file mode 100644
index 0000000..bd4135c
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/097.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))</script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/098.html b/LayoutTests/fast/encoding/resources/098.html
new file mode 100644
index 0000000..65ea60d
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/098.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9">
+<!-- control for next four tests -->
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9">
+&lt;!-- control for next four tests --></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/099.html b/LayoutTests/fast/encoding/resources/099.html
new file mode 100644
index 0000000..bdd0529
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/099.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))</script>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))&lt;/script>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/100.html b/LayoutTests/fast/encoding/resources/100.html
new file mode 100644
index 0000000..af063a9
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/100.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))</script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
+&lt;script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/101.html b/LayoutTests/fast/encoding/resources/101.html
new file mode 100644
index 0000000..9deb659
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/101.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))</script>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))</script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))&lt;/script>
+&lt;script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/102.html b/LayoutTests/fast/encoding/resources/102.html
new file mode 100644
index 0000000..9058fcd
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/102.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))</script>
+<script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))</script>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))&lt;/script>
+&lt;script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))&lt;/script></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/103.html b/LayoutTests/fast/encoding/resources/103.html
new file mode 100644
index 0000000..110f8ee
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/103.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset0charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset0charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/104.html b/LayoutTests/fast/encoding/resources/104.html
new file mode 100644
index 0000000..358336f
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/104.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset-charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset-charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/105.html b/LayoutTests/fast/encoding/resources/105.html
new file mode 100644
index 0000000..da406fc
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/105.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset!charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset!charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/106.html b/LayoutTests/fast/encoding/resources/106.html
new file mode 100644
index 0000000..000bd58
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/106.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset;charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset;charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/107.html b/LayoutTests/fast/encoding/resources/107.html
new file mode 100644
index 0000000..8362798
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/107.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/108.html b/LayoutTests/fast/encoding/resources/108.html
new file mode 100644
index 0000000..c07bf87
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/108.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset charset=ISO-8859-9">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset charset=ISO-8859-9"></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/109.html b/LayoutTests/fast/encoding/resources/109.html
new file mode 100644
index 0000000..2f0b6de
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/109.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta content=" text/html; charset = ISO-8859-9 " http-equiv="Content-Type" >
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content=" text/html; charset = ISO-8859-9 " http-equiv="Content-Type" ></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/110.html b/LayoutTests/fast/encoding/resources/110.html
new file mode 100644
index 0000000..ca10669
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/110.html
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML>
+<meta content="
+text/html; charset=ISO-8859-9
+"
+http-equiv="Content-Type"
+>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta content="
+text/html; charset=ISO-8859-9
+"
+http-equiv="Content-Type"
+></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/111.html b/LayoutTests/fast/encoding/resources/111.html
new file mode 100644
index 0000000..d53ae88
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/111.html
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML>
+<meta
+content
+=
+"
+text/html; charset=ISO-8859-9
+"
+http-equiv
+=
+"Content-Type"
+>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta
+content
+=
+"
+text/html; charset=ISO-8859-9
+"
+http-equiv
+=
+"Content-Type"
+></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/112.html b/LayoutTests/fast/encoding/resources/112.html
new file mode 100644
index 0000000..7a8378e
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/112.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset="ISO-8859-9"'> <!-- control for next test -->
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset="ISO-8859-9"'> &lt;!-- control for next test --></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/113.html b/LayoutTests/fast/encoding/resources/113.html
new file mode 100644
index 0000000..f169cf9
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/113.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset="IS\O-8859-9"'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset="IS\O-8859-9"'></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/114.html b/LayoutTests/fast/encoding/resources/114.html
new file mode 100644
index 0000000..8519eda
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/114.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset="IS/O-8859-9"'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset="IS/O-8859-9"'></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/115.html b/LayoutTests/fast/encoding/resources/115.html
new file mode 100644
index 0000000..ffdcefc
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/115.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=&quot;ISO-8859-9&quot;"> <!-- control for next test -->
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=&amp;quot;ISO-8859-9&amp;quot;"> &lt;!-- control for next test --></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/116.html b/LayoutTests/fast/encoding/resources/116.html
new file mode 100644
index 0000000..97632aa
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/116.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=&quot;IS\O-8859-9&quot;">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=&amp;quot;IS\O-8859-9&amp;quot;"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/117.html b/LayoutTests/fast/encoding/resources/117.html
new file mode 100644
index 0000000..695c45c
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/117.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html;charset=&quot;IS/O-8859-9&quot;">
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content="text/html;charset=&amp;quot;IS/O-8859-9&amp;quot;"></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/118.html b/LayoutTests/fast/encoding/resources/118.html
new file mode 100644
index 0000000..23022d7
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/118.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset=IS\O-8859-9'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset=IS\O-8859-9'></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/119.html b/LayoutTests/fast/encoding/resources/119.html
new file mode 100644
index 0000000..58970a1
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/119.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset=IS/O-8859-9'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset=IS/O-8859-9'></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/120.html b/LayoutTests/fast/encoding/resources/120.html
new file mode 100644
index 0000000..58970a1
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/120.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset=IS/O-8859-9'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset=IS/O-8859-9'></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/121.html b/LayoutTests/fast/encoding/resources/121.html
new file mode 100644
index 0000000..5cdce36
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/121.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset=IS\\O!8!8!5!9*9'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset=IS\\O!8!8!5!9*9'></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/122.html b/LayoutTests/fast/encoding/resources/122.html
new file mode 100644
index 0000000..fdbb8c4
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/122.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;charset="ISO-8859-1\"5"'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;charset="ISO-8859-1\"5"'></pre>
+<p>Expected result: <span id="expected">Windows-1252</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/123.html b/LayoutTests/fast/encoding/resources/123.html
new file mode 100644
index 0000000..25cdeb8
--- /dev/null
+++ b/LayoutTests/fast/encoding/resources/123.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content='text/html;bogus="\";charset=ISO-8859-9;bogus="'>
+<p>Test:
+<pre>&lt;!DOCTYPE HTML>
+&lt;meta http-equiv="Content-Type" content='text/html;bogus="\";charset=ISO-8859-9;bogus="'></pre>
+<p>Expected result: <span id="expected">Windows-1254</span>
+<div>
+ <style scoped>
+ .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
+ .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
+ </style>
+ <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
+ <p>Result: <span id="result">Script did not run.</span>
+ <script>
+ var encoding = 'unknown';
+ if ('à' == '\u00E0') { // 0xE0
+ if ('™' == '\u2122') { // 0x99
+ if ('þ' == '\u00FE') // 0xFE
+ encoding = 'Windows-1252';
+ else if ('þ' == '\u015F')
+ encoding = 'Windows-1254';
+ else if ('þ' == '\u200F')
+ encoding = 'Windows-1256';
+ else if ('þ' == '\u20AB')
+ encoding = 'Windows-1258';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
+ } else if ('ÿ' == '\u02D9') // 0xFF
+ encoding = 'ISO-8859-3';
+ else if ('þ' == '\u0177') // 0xFE
+ encoding = 'ISO-8859-14';
+ else if ('þ' == '\u021B')
+ encoding = 'ISO-8859-16';
+ else if ('þ' == '\u015F')
+ encoding = 'ISO-8859-9';
+ else if ('¾' == '\u00BE') // 0xBE
+ encoding = 'ISO-8859-1';
+ else if ('¾' == '\u0178')
+ encoding = 'ISO-8859-15';
+ else
+ encoding = 'unknown with 0xE0 = U+00E0';
+ } else if ('à' == '\u0101') // 0xE0
+ encoding = 'ISO-8859-10';
+ else if ('à' == '\u0E40') // 0xE0
+ encoding = 'ISO-8859-11';
+ else if ('à' == '\uFFFD') { // 0xE0
+ if ('☺' == '\u263A') // 0xE2 0x98 0xBA
+ encoding = 'UTF-8';
+ else
+ encoding = 'unknown (but ASCII-compatible)';
+ }
+ document.getElementById('encoding').firstChild.data = encoding;
+ var expected = document.getElementById('expected').firstChild.data;
+ if (expected == '(demo - no expected result)') {
+ document.getElementById('result').firstChild.data = 'demo';
+ } else if (encoding == expected) {
+ document.getElementById('result').firstChild.data = 'PASS';
+ document.getElementById('result').className = 'pass';
+ } else {
+ document.getElementById('result').firstChild.data = 'FAIL';
+ document.getElementById('result').className = 'fail';
+ }
+ if (parent.receivedResults)
+ parent.receivedResults();
+ </script>
+</div>
diff --git a/LayoutTests/fast/encoding/resources/char-decoding-utils.js b/LayoutTests/fast/encoding/resources/char-decoding-utils.js
index a091ad8..07d2e60 100644
--- a/LayoutTests/fast/encoding/resources/char-decoding-utils.js
+++ b/LayoutTests/fast/encoding/resources/char-decoding-utils.js
@@ -9,14 +9,26 @@ function hex(number)
return hex;
}
-function decode(charsetName, characterSequence)
+function decodeText(charsetName, characterSequence)
{
var req = new XMLHttpRequest;
req.open('GET', 'data:text/plain,' + characterSequence, false);
req.overrideMimeType('text/plain; charset="' + charsetName + '"');
req.send('');
- var code = hex(req.responseText.charCodeAt(0));
- return "U+" + ("0000" + code).substr(code.length, 4);
+ return req.responseText;
+}
+
+function decode(charsetName, characterSequence)
+{
+ var decodedText = decodeText(charsetName, characterSequence);
+ var result = "";
+ for (var i = 0; i < decodedText.length; ++i) {
+ var code = hex(decodedText.charCodeAt(i));
+ if (i)
+ result += "/";
+ result += "U+" + ("0000" + code).substr(code.length, 4);
+ }
+ return result;
}
function testDecode(charsetName, characterSequence, unicode)
diff --git a/LayoutTests/fast/encoding/tag-name-digit-expected.txt b/LayoutTests/fast/encoding/tag-name-digit-expected.txt
new file mode 100644
index 0000000..0ba3825
--- /dev/null
+++ b/LayoutTests/fast/encoding/tag-name-digit-expected.txt
@@ -0,0 +1,3 @@
+<0notatag>
+PASS: windows-1255
+This test checks that charset sniffer does not get confused by text that looks like a tag whose name begins with a digit.
diff --git a/LayoutTests/fast/encoding/tag-name-digit.html b/LayoutTests/fast/encoding/tag-name-digit.html
new file mode 100644
index 0000000..209f506
--- /dev/null
+++ b/LayoutTests/fast/encoding/tag-name-digit.html
@@ -0,0 +1,26 @@
+<html>
+<title>Test a tag name that begins with a digit</title>
+<0notatag>
+<!-- at least 1024 bytes to test that a meta tag after 1024 bytes will still be considered, indicating the bogus tag name was not treated as a tag that ends the head section.
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+-->
+<meta charset=windows-1255>
+<body>
+<pre id="log"></pre>
+<script>
+function log(message)
+{
+ document.getElementById("log").innerText += message + "\n";
+}
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+if (document.inputEncoding == "windows-1255")
+ log("PASS: " + document.inputEncoding);
+else
+ log("FAIL: " + document.inputEncoding);
+</script>
+<p>This test checks that charset sniffer does not get confused by text that looks like a tag whose name begins with a digit.</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/standalone-pre.js b/LayoutTests/fast/js/resources/standalone-pre.js
index 692f1c1..b80c3cb 100644
--- a/LayoutTests/fast/js/resources/standalone-pre.js
+++ b/LayoutTests/fast/js/resources/standalone-pre.js
@@ -27,6 +27,8 @@ function testFailed(msg)
function areArraysEqual(_a, _b)
{
+ if (Object.prototype.toString.call(_a) != Object.prototype.toString.call([]))
+ return false;
if (_a.length !== _b.length)
return false;
for (var i = 0; i < _a.length; i++)
diff --git a/LayoutTests/fast/xpath/4XPath/Core/test.js b/LayoutTests/fast/xpath/4XPath/Core/test.js
index bfb7c8a..6cbe16e 100644
--- a/LayoutTests/fast/xpath/4XPath/Core/test.js
+++ b/LayoutTests/fast/xpath/4XPath/Core/test.js
@@ -33,6 +33,7 @@ ROOT = DOM.documentElement;
PI = DOM.firstChild;
while (PI.nodeType != Node.PROCESSING_INSTRUCTION_NODE)
PI = PI.nextSibling;
+
PI2 = DOM.lastChild;
COMMENT = ROOT.firstChild
while (COMMENT.nodeType != Node.COMMENT_NODE)
diff --git a/LayoutTests/fast/xpath/ambiguous-operators-expected.txt b/LayoutTests/fast/xpath/ambiguous-operators-expected.txt
new file mode 100644
index 0000000..02290f2
--- /dev/null
+++ b/LayoutTests/fast/xpath/ambiguous-operators-expected.txt
@@ -0,0 +1,73 @@
+Test that an NCName and * are interpreted as an operator when in binary operator context, and as a NameTest otherwise.
+
+See bug 50366: XPath lexer misinterprets expression starting with "div".
+
+PASS div
+PASS div
+PASS (div) div (div)
+PASS self::node()[div] div 1
+PASS . div .
+PASS .. div ..
+PASS string(div/@div)
+PASS substring-before('1992', div)
+PASS self::div
+PASS * div 4
+PASS '3' div 4
+PASS "3" div 4
+PASS 12 div 4
+PASS true() and div
+PASS false() or div
+PASS div mod div
+PASS div div div
+PASS 3 * div
+PASS div/div
+PASS div//div
+PASS zz|div
+PASS div+div
+PASS - - div
+PASS 5 -div
+PASS div=div
+PASS div!=div
+PASS div<div
+PASS div<=div
+PASS div>div
+PASS div>=div
+PASS *
+PASS *
+PASS (*) * (*)
+PASS self::node()[*] * 1
+PASS . * .
+PASS .. * ..
+PASS substring-before('1992', *)
+PASS self::*
+PASS * * 4
+PASS '3' * 4
+PASS "3" * 4
+PASS 12 * 4
+PASS true() and *
+PASS false() or *
+PASS * mod *
+PASS * div *
+PASS 3 * *
+PASS */*
+PASS *//*
+PASS zz|*
+PASS *+*
+PASS - - *
+PASS 5 -*
+PASS *=*
+PASS *!=*
+PASS *<*
+PASS *<=*
+PASS *>*
+PASS *>=*
+PASS or:or
+PASS or:*
+PASS mod
+PASS mod mod mod
+PASS (mod) mod 5
+PASS string(mod/@and)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/xpath/ambiguous-operators.html b/LayoutTests/fast/xpath/ambiguous-operators.html
new file mode 100644
index 0000000..f22a185
--- /dev/null
+++ b/LayoutTests/fast/xpath/ambiguous-operators.html
@@ -0,0 +1,118 @@
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+<script src="xpath-test-pre.js"></script>
+<style>
+#context {display:none}
+</style>
+</head>
+<body>
+<p>Test that an NCName and * are interpreted as an operator when in
+binary operator context, and as a NameTest otherwise.
+
+<p>See <a href="http://bugs.webkit.org/show_bug.cgi?id=50366">bug 50366</a>:
+XPath lexer misinterprets expression starting with "div".</p>
+
+<div id="console"></div>
+
+<div id="context">
+ <div id="two" div="x">2</div>
+</div>
+
+<script>
+var context = document.getElementById('context');
+var div = document.getElementById('two');
+
+// =========== div ===========
+
+test(document, context, "div", [div], null); // div with no preceding token
+test(document, context, " div", [div], null);
+// div following every possible [28] ExprToken http://www.w3.org/TR/xpath/
+test(document, context, "(div) div (div)", 2/2, null); // div after ( and )
+test(document, context, "self::node()[div] div 1", 2/1, null); // div after [ and ]
+test(document, context, ". div .", 2/2, null); // div after .
+test(document, div, ".. div ..", 2/2, null); // div after ..
+test(document, context, "string(div/@div)", "x", null); // div after @
+test(document, context, "substring-before('1992', div)", "199", null); // div after ,
+test(document, div, "self::div", [div], null); // div after ::
+test(document, context, "* div 4", 2/4, null); // div after NameTest *
+test(document, context, "'3' div 4", 3/4, null); // div after Literal
+test(document, context, "\"3\" div 4", 3/4, null); // div after Literal
+test(document, context, "12 div 4", 12/4, null); // div after Number
+
+// div following every [32] Operator
+test(document, context, "true() and div", true, null); // div after OperatorName and
+test(document, context, "false() or div", true, null); // div after OperatorName or
+test(document, context, "div mod div", 0, null); // div after OperatorName mod
+test(document, context, "div div div", 1, null); // div after OperatorName div
+test(document, context, "3 * div", 6, null); // div after MultiplyOperator
+test(document, context, "div/div", [], null); // div after /
+test(document, context, "div//div", [], null); // div after //
+test(document, context, "zz|div", [div], null); // div after |
+test(document, context, "div+div", 4, null); // div after +
+test(document, context, "- - div", 2, null); // div after unary -
+test(document, context, "5 -div", 3, null); // div after binary -
+test(document, context, "div=div", true, null); // div after =
+test(document, context, "div!=div", false, null); // div after =
+test(document, context, "div<div", false, null); // div after <
+test(document, context, "div<=div", true, null); // div after <=
+test(document, context, "div>div", false, null); // div after >
+test(document, context, "div>=div", true, null); // div after >=
+
+
+// =========== * ===========
+
+test(document, context, "*", [div], null); // * with no preceding token
+test(document, context, " *", [div], null);
+// * following every possible [28] ExprToken http://www.w3.org/TR/xpath/
+test(document, context, "(*) * (*)", 2*2, null); // * after ( and )
+test(document, context, "self::node()[*] * 1", 2*1, null); // * after [ and ]
+test(document, context, ". * .", 2*2, null); // * after .
+test(document, div, ".. * ..", 2*2, null); // * after ..
+// (* can't follow @)
+test(document, context, "substring-before('1992', *)", "199", null); // * after ,
+test(document, div, "self::*", [div], null); // * after ::
+test(document, context, "* * 4", 2*4, null); // * after NameTest *
+test(document, context, "'3' * 4", 3*4, null); // * after Literal
+test(document, context, "\"3\" * 4", 3*4, null); // * after Literal
+test(document, context, "12 * 4", 12*4, null); // * after Number
+
+// * following every [32] Operator
+test(document, context, "true() and *", true, null); // * after OperatorName and
+test(document, context, "false() or *", true, null); // * after OperatorName or
+test(document, context, "* mod *", 0, null); // * after OperatorName mod
+test(document, context, "* div *", 1, null); // * after OperatorName div
+test(document, context, "3 * *", 6, null); // * after MultiplyOperator
+test(document, context, "*/*", [], null); // * after /
+test(document, context, "*//*", [], null); // * after //
+test(document, context, "zz|*", [div], null); // * after |
+test(document, context, "*+*", 4, null); // * after +
+test(document, context, "- - *", 2, null); // * after unary -
+test(document, context, "5 -*", 3, null); // * after binary -
+test(document, context, "*=*", true, null); // * after =
+test(document, context, "*!=*", false, null); // * after =
+test(document, context, "*<*", false, null); // * after <
+test(document, context, "*<=*", true, null); // * after <=
+test(document, context, "*>*", false, null); // * after >
+test(document, context, "*>=*", true, null); // * after >=
+
+var xmlDoc = (new DOMParser).parseFromString("<or xmlns='uri'>5</or>", "text/xml");
+var nsResolver = function(prefix) {return 'uri';}
+// div and * after :
+test(xmlDoc, xmlDoc, "or:or", [xmlDoc.documentElement], nsResolver);
+test(xmlDoc, xmlDoc, "or:*", [xmlDoc.documentElement], nsResolver);
+
+// A few tests with mod as well
+var xmlDoc2 = (new DOMParser).parseFromString("<mod and='x'>8</mod>", "text/xml");
+test(xmlDoc2, xmlDoc2, "mod", [xmlDoc2.documentElement], null);
+test(xmlDoc2, xmlDoc2, "mod mod mod", 0, null);
+test(xmlDoc2, xmlDoc2, "(mod) mod 5", 3, null);
+test(xmlDoc2, xmlDoc2, "string(mod/@and)", 'x', null);
+
+
+var successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/resources/file-last-modified.php b/LayoutTests/http/tests/resources/file-last-modified.php
new file mode 100644
index 0000000..efcf950
--- /dev/null
+++ b/LayoutTests/http/tests/resources/file-last-modified.php
@@ -0,0 +1,7 @@
+<?php
+date_default_timezone_set('UTC');
+$filePath = $_GET['path'];
+if (file_exists($filePath)) {
+ echo date("U", filemtime($filePath));
+}
+?>
diff --git a/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt b/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt
index 6de4296..2fea061 100644
--- a/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt
+++ b/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage-expected.txt
@@ -1,7 +1,7 @@
This is a test to make sure that when private browsing is on any attempt to change the localStorage area fail.
-Initial value of testItem is: InitialValue
+Initial value of testItem is: null
Caught exception trying to change item: Error: QUOTA_EXCEEDED_ERR: DOM Exception 22
-After change attempt, testItem is: InitialValue
-After remove attempt, testItem is: InitialValue
-After clear attempt, testItem is: InitialValue
+After change attempt, testItem is: null
+After remove attempt, testItem is: null
+After clear attempt, testItem is: null
diff --git a/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt b/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt
index ed2017a..58c99f2 100644
--- a/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt
+++ b/LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects-storage-expected.txt
@@ -1,7 +1,7 @@
This is a test to make sure that when private browsing is on any attempt to change the sessionStorage area fail.
-Initial value of testItem is: InitialValue
+Initial value of testItem is: null
Caught exception trying to change item: Error: QUOTA_EXCEEDED_ERR: DOM Exception 22
-After change attempt, testItem is: InitialValue
-After remove attempt, testItem is: InitialValue
-After clear attempt, testItem is: InitialValue
+After change attempt, testItem is: null
+After remove attempt, testItem is: null
+After clear attempt, testItem is: null
diff --git a/LayoutTests/storage/hash-change-with-xhr.js b/LayoutTests/storage/hash-change-with-xhr.js
index 4290681..7f56f79 100644
--- a/LayoutTests/storage/hash-change-with-xhr.js
+++ b/LayoutTests/storage/hash-change-with-xhr.js
@@ -81,6 +81,12 @@ function invokeBack()
function runTest()
{
+ // Location changes need to happen outside the onload handler to generate history entries.
+ setTimeout(runTestsInner, 0);
+}
+
+function runTestsInner()
+{
backIterations = 10;
consecutiveFailures = 0;
successes = 0;
diff --git a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
new file mode 100644
index 0000000..1fdf9ed
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
@@ -0,0 +1,133 @@
+Test IndexedDB's openCursor.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+objectStore = db.createObjectStore('test')
+objectStore.add('myValue1', 'myKey1')
+objectStore.add('myValue2', 'myKey2')
+objectStore.add('myValue3', 'myKey3')
+objectStore.add('myValue4', 'myKey4')
+openCursor1
+trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)
+trans.objectStore('test').openCursor({range: keyRange})
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+event.result.delete()
+PASS event.result.value is "myValue1"
+event.result.continue()
+event.result.delete()
+PASS event.result.value is "myValue2"
+event.result.continue()
+event.result.delete()
+PASS event.result.value is "myValue3"
+event.result.continue()
+event.result.delete()
+PASS event.result.value is "myValue4"
+event.result.continue()
+PASS counter is 5
+trans.objectStore('test').openCursor({range: keyRange})
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+WARN: shouldBe() expects string arguments
+PASS null is null
+trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)
+objectStore = trans.objectStore('test')
+objectStore.add('myValue1', 'myKey1')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+openCursor2
+objectStore.openCursor({range: keyRange})
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS [object IDBCursor] is non-null.
+event.result.delete()
+objectStore.get('myKey1')
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/cursor-delete.html b/LayoutTests/storage/indexeddb/cursor-delete.html
new file mode 100644
index 0000000..ce62d6a
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-delete.html
@@ -0,0 +1,132 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB's openCursor.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+test();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ verifySuccessEvent(event);
+ var db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = setVersionSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersionSuccess()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = openCursor;
+
+ deleteAllObjectStores(db, createAndPopulateObjectStore);
+}
+
+function createAndPopulateObjectStore()
+{
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('test')");
+ evalAndLog("objectStore.add('myValue1', 'myKey1')");
+ evalAndLog("objectStore.add('myValue2', 'myKey2')");
+ evalAndLog("objectStore.add('myValue3', 'myKey3')");
+ evalAndLog("objectStore.add('myValue4', 'myKey4')");
+}
+
+function openCursor()
+{
+ debug("openCursor1");
+ evalAndLog("trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)");
+ keyRange = webkitIDBKeyRange.lowerBound("myKey1");
+ result = evalAndLog("trans.objectStore('test').openCursor({range: keyRange})");
+ verifyResult(result);
+ result.onsuccess = cursorSuccess;
+ result.onerror = unexpectedErrorCallback;
+ counter = 1;
+}
+
+function cursorSuccess()
+{
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ result = evalAndLog("trans.objectStore('test').openCursor({range: keyRange})");
+ verifyResult(result);
+ result.onsuccess = cursorEmpty;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+ evalAndLog("event.result.delete()");
+ shouldBeEqualToString("event.result.value", "myValue" + counter++);
+ evalAndLog("event.result.continue()");
+}
+
+function cursorEmpty()
+{
+ verifySuccessEvent(event);
+ shouldBeNull(event.result);
+ trans.oncomplete = addObject;
+}
+
+function addObject()
+{
+ evalAndLog("trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)");
+ objectStore = evalAndLog("objectStore = trans.objectStore('test')");
+ result = evalAndLog("objectStore.add('myValue1', 'myKey1')");
+ verifyResult(result);
+ result.onsuccess = openCursor2;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openCursor2()
+{
+ debug("openCursor2");
+ result = evalAndLog("objectStore.openCursor({range: keyRange})");
+ verifyResult(result);
+ result.onsuccess = deleteObject;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function deleteObject()
+{
+ verifySuccessEvent(event);
+ shouldBeNonNull(event.result);
+ evalAndLog("event.result.delete()");
+ result = evalAndLog("objectStore.get('myKey1')");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = verifyObjectDeleted;
+}
+
+function verifyObjectDeleted()
+{
+ verifyErrorEvent(event);
+ done();
+}
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
new file mode 100644
index 0000000..4598556
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
@@ -0,0 +1,134 @@
+Test IndexedDB's openCursor.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+objectStore = db.createObjectStore('test')
+objectStore.createIndex('testIndex', 'x')
+objectStore.add({x: 1}, 'myKey1')
+objectStore.add({x: 2}, 'myKey2')
+objectStore.add({x: 3}, 'myKey3')
+objectStore.add({x: 4}, 'myKey4')
+openCursor1
+trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)
+trans.objectStore('test').index('testIndex').openCursor({range: keyRange})
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+event.result.delete()
+PASS event.result.key is counter++
+event.result.continue()
+event.result.delete()
+PASS event.result.key is counter++
+event.result.continue()
+event.result.delete()
+PASS event.result.key is counter++
+event.result.continue()
+event.result.delete()
+PASS event.result.key is counter++
+event.result.continue()
+PASS counter is 5
+trans.objectStore('test').index('testIndex').openCursor({range: keyRange})
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is null
+trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)
+objectStore = trans.objectStore('test')
+objectStore.add({x: 1}, 'myKey1')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+openCursor2
+index = event.source.index('testIndex')
+index.openCursor({range: keyRange})
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS [object IDBCursor] is non-null.
+event.result.delete()
+index.get(1)
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/cursor-index-delete.html b/LayoutTests/storage/indexeddb/cursor-index-delete.html
new file mode 100644
index 0000000..ea10f02
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-index-delete.html
@@ -0,0 +1,136 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB's openCursor.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+test();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ verifySuccessEvent(event);
+ var db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = setVersionSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersionSuccess()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = openCursor;
+
+ deleteAllObjectStores(db, createAndPopulateObjectStoreAndIndex);
+}
+
+function createAndPopulateObjectStoreAndIndex()
+{
+ objectStore = evalAndLog("objectStore = db.createObjectStore('test')");
+ evalAndLog("objectStore.createIndex('testIndex', 'x')");
+
+ evalAndLog("objectStore.add({x: 1}, 'myKey1')");
+ evalAndLog("objectStore.add({x: 2}, 'myKey2')");
+ evalAndLog("objectStore.add({x: 3}, 'myKey3')");
+ evalAndLog("objectStore.add({x: 4}, 'myKey4')");
+}
+
+function openCursor()
+{
+ debug("openCursor1");
+ evalAndLog("trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)");
+ keyRange = webkitIDBKeyRange.lowerBound(1);
+ result = evalAndLog("trans.objectStore('test').index('testIndex').openCursor({range: keyRange})");
+ verifyResult(result);
+ result.onsuccess = cursorSuccess;
+ result.onerror = unexpectedErrorCallback;
+ counter = 1;
+}
+
+function cursorSuccess()
+{
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ result = evalAndLog("trans.objectStore('test').index('testIndex').openCursor({range: keyRange})");
+ verifyResult(result);
+ result.onsuccess = cursorEmpty;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+ var deleteResult = evalAndLog("event.result.delete()");
+ deleteResult.onerror = unexpectedErrorCallback;
+ shouldBe("event.result.key", "counter++");
+ evalAndLog("event.result.continue()");
+}
+
+function cursorEmpty()
+{
+ verifySuccessEvent(event);
+ shouldBeNull("event.result");
+ trans.oncomplete = addObject;
+}
+
+function addObject()
+{
+ evalAndLog("trans = db.transaction('test', webkitIDBTransaction.READ_WRITE)");
+ objectStore = evalAndLog("objectStore = trans.objectStore('test')");
+ result = evalAndLog("objectStore.add({x: 1}, 'myKey1')");
+ verifyResult(result);
+ result.onsuccess = openCursor2;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openCursor2()
+{
+ debug("openCursor2");
+ evalAndLog("index = event.source.index('testIndex')");
+ result = evalAndLog("index.openCursor({range: keyRange})");
+ verifyResult(result);
+ result.onsuccess = deleteObject;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function deleteObject()
+{
+ verifySuccessEvent(event);
+ shouldBeNonNull(event.result);
+ evalAndLog("event.result.delete()");
+ result = evalAndLog("index.get(1)");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = verifyObjectDeleted;
+}
+
+function verifyObjectDeleted()
+{
+ verifyErrorEvent(event);
+ done();
+}
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index e736d2f..17746d3 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -98,22 +98,13 @@ PASS store.indexNames.item(100) is null
transaction = db.transaction()
store = transaction.objectStore('storeName')
Try to insert data with a Date key:
-store.add({x: 'foo'}, new Date())
-PASS Exception thrown
-PASS code is DOMException.TYPE_MISMATCH_ERR
+store.add({x: 'foo'}, testDate)
Try to insert a value not handled by structured clone:
store.add({x: 'bar', y: document.getElementById('console')}, 'bar')
PASS Exception thrown
PASS code is DOMException.NOT_SUPPORTED_ERR
Try to insert data where key path yields a Date key:
-store.add({x: new Date()}, 'foo')
-PASS Adding data where key path yielded Date key resulted in error.
-store.add({x: 'value'}, 'key')
-PASS 'onsuccess' in result is true
-PASS 'onerror' in result is true
-PASS 'readyState' in result is true
-An event should fire shortly...
-
+store.add({x: new Date(), y: 'value'}, 'key')
addSuccess():
Success event fired:
PASS 'result' in event is true
@@ -127,7 +118,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.result is "key"
-event.source.add({x: 'value'}, 'zzz')
+event.source.add({x: 'foo'}, 'zzz')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
@@ -208,8 +199,22 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-PASS event.result.x is "value"
+PASS event.result.y is "value"
store = event.source
+store.get(testDate)
+getSuccessDateKey():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result.x is "foo"
store.delete('key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index 3d2a1d2..a368c01 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -136,6 +136,7 @@ function checkMetadata()
addData();
}
+var testDate = new Date("August 25, 1991 20:57:08");
function addData()
{
@@ -144,17 +145,13 @@ function addData()
window.store = evalAndLog("store = transaction.objectStore('storeName')");
debug("Try to insert data with a Date key:");
- // FIXME: This should work in the future.
- try {
- debug("store.add({x: 'foo'}, new Date())");
- store.add({x: 'foo'}, new Date());
- testFailed("Passing a Date as key argument should have thrown.");
- } catch (err) {
- testPassed("Exception thrown");
- code = err.code;
- shouldBe("code", "DOMException.TYPE_MISMATCH_ERR");
- }
+ result = evalAndLog("store.add({x: 'foo'}, testDate)");
+ result.onsuccess = addDateSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+function addDateSuccess()
+{
debug("Try to insert a value not handled by structured clone:");
try {
debug("store.add({x: 'bar', y: document.getElementById('console')}, 'bar')");
@@ -166,19 +163,8 @@ function addData()
shouldBe("code", "DOMException.NOT_SUPPORTED_ERR");
}
- // FIXME: This should work in the future.
debug("Try to insert data where key path yields a Date key:");
- result = evalAndLog("store.add({x: new Date()}, 'foo')");
- result.onsuccess = unexpectedSuccessCallback;
- result.onerror = addKeyPathYieldingDateFailure;
-}
-
-function addKeyPathYieldingDateFailure()
-{
- testPassed("Adding data where key path yielded Date key resulted in error.");
-
- result = evalAndLog("store.add({x: 'value'}, 'key')");
- verifyResult(result);
+ result = evalAndLog("store.add({x: new Date(), y: 'value'}, 'key')");
result.onsuccess = addSuccess;
result.onerror = unexpectedErrorCallback;
}
@@ -189,7 +175,7 @@ function addSuccess()
verifySuccessEvent(event);
shouldBeEqualToString("event.result", "key");
- result = evalAndLog("event.source.add({x: 'value'}, 'zzz')");
+ result = evalAndLog("event.source.add({x: 'foo'}, 'zzz')");
verifyResult(result);
result.onsuccess = unexpectedSuccessCallback;
result.onerror = addAgainFailure;
@@ -248,8 +234,19 @@ function getSuccess()
{
debug("getSuccess():");
verifySuccessEvent(event);
- shouldBeEqualToString("event.result.x", "value");
+ shouldBeEqualToString("event.result.y", "value");
+
var store = evalAndLog("store = event.source");
+ result = evalAndLog("store.get(testDate)");
+ result.onsuccess = getSuccessDateKey;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getSuccessDateKey()
+{
+ debug("getSuccessDateKey():");
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result.x", "foo");
result = evalAndLog("store.delete('key')");
verifyResult(result);
diff --git a/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt b/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt
new file mode 100644
index 0000000..413643c
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt
@@ -0,0 +1,32 @@
+Test IndexedDB transaction does not crash on abort.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'webkitIndexedDB' in window is true
+PASS webkitIndexedDB == null is false
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+openSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.transaction([])
+window.gc()
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html b/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html
new file mode 100644
index 0000000..1b13c87
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html
@@ -0,0 +1,44 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB transaction does not crash on abort.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ shouldBeTrue("'webkitIndexedDB' in window");
+ shouldBeFalse("webkitIndexedDB == null");
+
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ debug("openSuccess():");
+ verifySuccessEvent(event);
+ db = evalAndLog("db = event.result");
+ evalAndLog("db.transaction([])");
+ evalAndLog("window.gc()");
+ done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/private-browsing-readonly-expected.txt b/LayoutTests/storage/private-browsing-noread-nowrite-expected.txt
index d5f4e0b..7542ba6 100644
--- a/LayoutTests/storage/private-browsing-readonly-expected.txt
+++ b/LayoutTests/storage/private-browsing-noread-nowrite-expected.txt
@@ -9,5 +9,7 @@ Private browsing statement 3 completed with an error
not authorized
Private browsing statement 4 completed with an error
not authorized
+Private browsing statement 5 completed with an error
+access to PrivateTest1.randomData is prohibited
Test ended
diff --git a/LayoutTests/storage/private-browsing-readonly.html b/LayoutTests/storage/private-browsing-noread-nowrite.html
index 972b123..b9b5882 100644
--- a/LayoutTests/storage/private-browsing-readonly.html
+++ b/LayoutTests/storage/private-browsing-noread-nowrite.html
@@ -16,7 +16,8 @@ var privateBrowsingStatements = [
"CREATE TABLE IF NOT EXISTS PrivateTest2 (randomData)",
"DELETE FROM PrivateTest1",
"DROP TABLE PrivateTest1",
- "INSERT INTO PrivateTest1 VALUES ('somedata')"
+ "INSERT INTO PrivateTest1 VALUES ('somedata')",
+ "SELECT * FROM PrivateTest1"
];
var completed = 0;
@@ -88,7 +89,7 @@ function runTest()
layoutTestController.waitUntilDone();
}
- var database = openDatabase("PrivateBrowsingReadOnlyTest", "1.0", "Test private browsing read-only safety", 1);
+ var database = openDatabase("PrivateBrowsingNoReadNoWriteTest", "1.0", "Test private browsing no read/write safety", 1);
database.transaction(runSetup, endTest, endTest);
}