Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text / international / bounds-white-space-pre.html
blobbfa20e7c6d073bd0c8217acb78736e1575248322
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <style>
6 #container {
7 font-size: 25px;
9 </style>
10 <div id="container">
11 <div>شییش ی ی ی ی ی</div>
12 <div style="white-space:pre">شییش ی ی ی ی ی</div>
13 </div>
14 <script>
15 runTests();
16 function runTests() {
17 var expectedNode = container.firstElementChild.firstChild;
18 var targetNode = container.lastElementChild.firstChild;
19 for (var i = 0; i < expectedNode.length; i++) {
20 test(function () {
21 assert_equals(getX(targetNode, i), getX(expectedNode, i));
22 }, "Index " + i);
25 if (window.testRunner)
26 container.style.display = "none";
29 function getX(node, offset) {
30 var range = document.createRange();
31 range.setStart(node, offset);
32 range.setEnd(node, offset + 1);
33 var bounds = range.getBoundingClientRect();
34 return bounds.left;
36 </script>