9 -webkit-column-gap:
20px;
21 <p id=
"description"></p>
22 <div id=
"console"></div>
24 <div id=
"mc">xxx xxx xxx xxx xxx xxx xxx xxx xxx
</div>
25 <script src=
"../../resources/js-test.js"></script>
27 description("Test that hitting areas outside columns takes us to the right text content inside columns.");
29 debug("Above first column:");
30 shouldBe("document.caretRangeFromPoint(50,0).startOffset", "0");
31 shouldBe("document.caretRangeFromPoint(150,0).startOffset", "0");
32 shouldBe("document.caretRangeFromPoint(189,0).startOffset", "0");
34 debug("Above second column:");
35 shouldBe("document.caretRangeFromPoint(190,0).startOffset", "12");
36 shouldBe("document.caretRangeFromPoint(250,0).startOffset", "12");
37 shouldBe("document.caretRangeFromPoint(289,0).startOffset", "12");
39 debug("Above third column:");
40 shouldBe("document.caretRangeFromPoint(290,0).startOffset", "24");
41 shouldBe("document.caretRangeFromPoint(350,0).startOffset", "24");
42 shouldBe("document.caretRangeFromPoint(450,0).startOffset", "24");
44 debug("Below first column:");
45 shouldBe("document.caretRangeFromPoint(50,100).startOffset", "12");
46 shouldBe("document.caretRangeFromPoint(150,100).startOffset", "12");
47 shouldBe("document.caretRangeFromPoint(189,100).startOffset", "12");
49 debug("Below second column:");
50 shouldBe("document.caretRangeFromPoint(190,100).startOffset", "24");
51 shouldBe("document.caretRangeFromPoint(250,100).startOffset", "24");
52 shouldBe("document.caretRangeFromPoint(289,100).startOffset", "24");
54 debug("To the left of the first column:");
55 shouldBe("document.caretRangeFromPoint(0,10).startOffset", "0");
56 shouldBe("document.caretRangeFromPoint(0,30).startOffset", "0");
57 shouldBe("document.caretRangeFromPoint(0,50).startOffset", "4");
58 shouldBe("document.caretRangeFromPoint(0,70).startOffset", "8");
59 shouldBe("document.caretRangeFromPoint(0,90).startOffset", "12");
61 debug("To the right of the third column:");
62 shouldBe("document.caretRangeFromPoint(400,10).startOffset", "24");
63 shouldBe("document.caretRangeFromPoint(400,30).startOffset", "27");
64 shouldBe("document.caretRangeFromPoint(400,50).startOffset", "31");
65 shouldBe("document.caretRangeFromPoint(400,70).startOffset", "35");
67 debug("In the gap between the first and second columns:");
68 shouldBe("document.caretRangeFromPoint(180,20).startOffset", "3");
69 shouldBe("document.caretRangeFromPoint(180,40).startOffset", "7");
70 shouldBe("document.caretRangeFromPoint(180,60).startOffset", "11");
71 shouldBe("document.caretRangeFromPoint(180,69).startOffset", "11");
73 debug("In the gap between the second and third columns:");
74 shouldBe("document.caretRangeFromPoint(280,20).startOffset", "15");
75 shouldBe("document.caretRangeFromPoint(280,40).startOffset", "19");
76 shouldBe("document.caretRangeFromPoint(280,60).startOffset", "23");
77 shouldBe("document.caretRangeFromPoint(280,69).startOffset", "23");