Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / multicol / hit-test-above-or-below.html
blob23cb57b34bf1e57c34252b2d9a5f9c611b8282b8
1 <body style="margin: 0">
2 <div style="margin: 50px; background-color: lightblue; width: 800px; height: 200px; -webkit-column-width:185px; -webkit-column-gap:15px; column-width:185px; column-gap:15px; column-fill:auto; font-family: Ahem; font-size: 50px; line-height: 1;">
3 123<div style="background-color: blue; height: 70px;"></div>abc<br>def<div style="background-color: blue; height: 60px;"></div>ghi<br>jkl<div style="background-color: blue; height: 110px;"></div>mno</div>
4 <pre id="console" style="display: none;"></pre>
5 <script>
6 if (window.internals)
7 internals.settings.setEditingBehavior("mac");
8 function characterAtPoint(x, y)
10 var range = document.caretRangeFromPoint(x, y);
11 if (range.startContainer.nodeType !== Node.TEXT_NODE)
12 return null;
13 if (range.startOffset >= range.startContainer.length)
14 return null;
15 return range.startContainer.data[range.startOffset];
18 function log(message)
20 document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
23 function test(x, y, character)
25 var actualCharacter = characterAtPoint(x, y);
26 if (character === actualCharacter)
27 log ("Character at " + x + ", " + y + " is " + character + " as expected.");
28 else
29 log ("FAIL: Character at " + x + ", " + y + " is " + actualCharacter + ". Expected " + character + ".");
32 if (window.testRunner)
33 testRunner.dumpAsText();
35 test(150, 25, "1");
36 test(350, 25, "d");
37 test(550, 25, "j");
38 test(750, 25, "m");
40 test(150, 275, "d");
41 test(350, 275, "j");
42 test(550, 275, "m");
43 test(750, 275, null);
45 test(150, 475, "d");
46 test(350, 475, "j");
47 test(550, 475, "m");
48 test(750, 475, null);
50 document.getElementById("console").style.display = "block";
51 </script>