Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text / international / combining-marks-position.html
blobe575c4ca1df13a090a0c75abbf38884a22841fe3
1 <html>
2 <head>
3 <meta charset="utf-8" />
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
7 </script>
8 </head>
9 <body>
10 <p>
11 This test ensures that combining marks apper over the previous (or next) character by comparing the length of
12 words (one has marks, and the other doesn't have marks).
13 </p>
15 <div style="font-family: arial; text-rendering: optimizeLegibility;">
16 <span id="reference1">test проверка</span>
17 </div>
18 <div style="font-family: arial;">
19 <span id="target1">te&#768;st прове&#768;рка</span>
20 </div>
22 <div>
23 <span id="reference2">خانه</span>
24 </div>
25 <div>
26 <span id="target2">خانهٔ</span>
27 </div>
29 <div id="result"></div>
31 <script>
32 var reference1 = document.getElementById('reference1');
33 var target1 = document.getElementById('target1');
34 var reference2 = document.getElementById('reference2');
35 var target2 = document.getElementById('target2');
36 var result = document.getElementById('result');
38 // Ignore a slight diff of the width between target and reference.
39 var diff1 = Math.abs(reference1.offsetWidth - target1.offsetWidth);
40 var diff2 = Math.abs(reference2.offsetWidth - target2.offsetWidth);
41 if (diff1 < 2 && diff2 < 2)
42 result.innerHTML = 'PASS. The length of targets and references are the same.<br />'
43 else
44 result.innerHTML = 'FAIL<br />' +
45 'reference1.offsetWidth = ' + reference1.offsetWidth + '<br />' +
46 'target1.offsetWidth = ' + target1.offsetWidth + '<br />' +
47 'reference2.offsetWidth = ' + reference2.offsetWidth + '<br />' +
48 'target2.offsetWidth = ' + target2.offsetWidth + '<br />'
49 </script>
51 </body>
52 </html>