OLD | NEW |
(Empty) | |
| 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; |
| 8 } |
| 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); |
| 23 } |
| 24 |
| 25 if (window.testRunner) |
| 26 container.style.display = "none"; |
| 27 } |
| 28 |
| 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; |
| 35 } |
| 36 </script> |
OLD | NEW |