Chromium Code Reviews| Index: LayoutTests/fast/text/international/bounds-white-space-pre.html |
| diff --git a/LayoutTests/fast/text/international/bounds-white-space-pre.html b/LayoutTests/fast/text/international/bounds-white-space-pre.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a2bbd308a5407d5e12e4ff1d9afab9ab48339b32 |
| --- /dev/null |
| +++ b/LayoutTests/fast/text/international/bounds-white-space-pre.html |
| @@ -0,0 +1,37 @@ |
| +<!DOCTYPE html> |
| +<meta charset="utf-8"> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<style> |
| +#container { |
| + font-size: 25px; |
| +} |
| +</style> |
| +<div id="container"> |
| + <div>شییش ی ی ی ی ی</div> |
| + <div style="white-space:pre">شییش ی ی ی ی ی</div> |
| +</div> |
| +<script> |
| +runTests(); |
| +function runTests() { |
| + var nodes = container.querySelectorAll("div"); |
| + var expectedNode = nodes[0].firstChild; |
|
eae
2015/08/19 15:38:10
Nit,
var expectedNode = container.firstElementChi
kojii
2015/08/20 05:00:30
Done.
|
| + var targetNode = nodes[1].firstChild; |
| + for (var i = 0; i < expectedNode.length; i++) { |
| + test(function () { |
| + assert_equals(getX(targetNode, i), getX(expectedNode, i)); |
| + }, "Index " + i); |
| + } |
| + |
| + if (window.testRunner) |
| + container.style.display = "none"; |
| +} |
| + |
| +function getX(node, offset) { |
| + var range = document.createRange(); |
| + range.setStart(node, offset); |
| + range.setEnd(node, offset + 1); |
| + var bounds = range.getBoundingClientRect(); |
| + return bounds.left; |
| +} |
| +</script> |