Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / writing-mode / flipped-blocks-hit-test-line-edges.html
blob07ac5c515f9349c8493fbc7096e5846d8b1d23e7
1 <!DOCTYPE html>
2 <script src="../../resources/ahem.js"></script>
3 <div id="target" style="
4 outline: dashed lightblue;
5 width: 150px;
6 padding: 25px;
7 font: 20px Ahem;
8 -webkit-writing-mode: horizontal-bt;
9 ">Lorem ipsum dolor sit amet</div>
10 <pre id="log"></pre>
11 <script>
12 if (window.testRunner && window.internals) {
13 testRunner.dumpAsText();
14 internals.settings.setEditingBehavior("mac");
17 function log(message)
19 document.getElementById("log").appendChild(document.createTextNode(message + "\n"));
22 function test(x, y, expectedOffset)
24 var actualOffset = document.caretRangeFromPoint(8 + x, 8 + y).startOffset;
25 if (actualOffset === expectedOffset)
26 log("PASS: offset at (" + x + "," + y + ") was " + actualOffset + ".");
27 else
28 log("FAIL: offset at (" + x + "," + y + ") was " + actualOffset + ". Expected " + expectedOffset + ".");
31 test(100, 105, 4);
32 test(160, 105, 5);
33 test(100, 104, 10);
34 test(160, 104, 11);
35 test(60, 26, 24);
36 test(160, 26, 26);
37 test(60, 25, 24);
38 test(160, 25, 26);
39 test(60, 24, 26);
40 test(160, 24, 26);
41 </script>