Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text / international / iso-8859-8.html
blobc97a79c99524212430407a33641856859d8e07c8
2 <html>
3 <head>
4 <meta charset="ISO-8859-8">
5 <body>
6 <p>Test rendering of ISO-8859-8.
7 <p>
8 <div class="test">ùðá</div>
9 <div class="test">ùðá â÷ë </div>
10 <div class="test">ùðá abc â÷ë</div>
11 <div class="test">abc ùðá def</div>
12 <div class="test">ùðá <span dir=ltr>â÷ë</span></div>
13 <div class="test">ùðá <span dir=rtl>â÷ë</span></div>
14 <ul id="console" dir=ltr></ul>
16 <script src="../../../resources/js-test.js"></script>
17 <script>
18 var succeed = true;
20 function checkClientRect(test, index, offset, dir, char)
22 if (test.nodeType == 3) {
23 for (var i = 0; i < test.textContent.length; ++i) {
24 range.setStart(test, i);
25 range.setEnd(test, i+1);
26 rects = range.getClientRects();
27 if (dir == "ltr") {
28 if (rects[0].left < offset) {
29 testFailed("Test " + index + " LTR: character " + range.toString() + " should be rendered right of " + char);
30 succeed = false;
33 } else {
34 if (rects[0].left > offset) {
35 testFailed("Test " + index + " RTL: character " + range.toString() + " should be rendered left of " + char);
36 succeed = false;
39 offset = rects[0].left;
40 char = range.toString();
43 } else if (test.nodeType == 1) {
44 for (var node = test.firstChild; node; node = node.nextSibling) {
45 checkClientRect(node, index, offset, dir, char);
50 if (window.testRunner)
51 testRunner.dumpAsText();
53 var tests = document.getElementsByClassName('test');
54 var range = document.createRange();
55 for (var i = 0; i < tests.length; ++i) {
56 checkClientRect(tests[i], i, -1, "ltr", " ");
58 tests[i].style.direction = "rtl";
59 checkClientRect(tests[i], i, 10000, "rtl", " ");
61 tests[i].style.display = "none";
63 if (succeed == true)
64 testPassed("Test completed successfully");
65 </script>
66 </body>
67 </html>