blob: 192e25e38b33a04f4db54b90ec2140e97401e267 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8"/>
<title>ISO 2022-JP decoding</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="author" title="Richard Ishida" href="mailto:ishida@w3.org">
<link rel="help" href="https://encoding.spec.whatwg.org/#iso-2022-jp">
<meta name="assert" content="The browser decodes all characters as expected from a file generated by encoding all pointers in the iso-2022-jp encoding per the encoder steps in the specification.">
<style>
iframe { display:none }
</style>
<script src="jis0208_index.js"></script>
<script src="iso2022jp-decoder.js"></script>
</head>
<body onload="showNodes();">
<iframe src="iso2022jp_chars.html" name="scriptWindow" id="scrwin"></iframe>
<div id="log"></div>
<script>
var tests = [];
function iframeRef(frameRef) {
return frameRef.contentWindow
? frameRef.contentWindow.document
: frameRef.contentDocument;
}
function showNodes() {
var iframe = iframeRef(document.getElementById("scrwin"));
nodes = iframe.querySelectorAll("span");
for (var i = 0; i < nodes.length; i++) {
tests[i] = async_test(
"U+" +
nodes[i].dataset.cp +
" " +
String.fromCodePoint(parseInt(nodes[i].dataset.cp, 16)) +
" " +
iso2022jpDecoder(nodes[i].dataset.bytes) +
" " +
nodes[i].dataset.bytes
);
}
for (var i = 0; i < nodes.length; i++) {
tests[i].step(function() {
assert_equals(
nodes[i].textContent,
iso2022jpDecoder(nodes[i].dataset.bytes)
);
});
tests[i].done();
}
}
</script>
</body>
</html>