7 /* Need a wrapper to establish the writing mode, thanks to crbug.com/
463462 */
9 -webkit-writing-mode: vertical-lr;
17 -webkit-column-gap:
20px;
19 unicode-bidi: bidi-override;
30 <p id=
"description"></p>
31 <div id=
"console"></div>
34 <div id=
"mc">xxx xxx xxx xxx xxx xxx xxx xxx xxx
</div>
36 <script src=
"../../../resources/js-test.js"></script>
38 description("Test that hitting areas outside columns takes us to the right text content inside columns.");
40 debug("To the left of the first column:");
41 shouldBe("document.caretRangeFromPoint(0,309).startOffset", "0");
42 shouldBe("document.caretRangeFromPoint(0,270).startOffset", "0");
43 shouldBe("document.caretRangeFromPoint(0,211).startOffset", "0");
45 debug("To the left of the second column:");
46 shouldBe("document.caretRangeFromPoint(0,210).startOffset", "12");
47 shouldBe("document.caretRangeFromPoint(0,170).startOffset", "12");
48 shouldBe("document.caretRangeFromPoint(0,111).startOffset", "12");
50 debug("To the left of the third column:");
51 shouldBe("document.caretRangeFromPoint(0,110).startOffset", "24");
52 shouldBe("document.caretRangeFromPoint(0,70).startOffset", "24");
53 shouldBe("document.caretRangeFromPoint(0,0).startOffset", "24");
55 debug("To the right of the first column:");
56 shouldBe("document.caretRangeFromPoint(400,309).startOffset", "12");
57 shouldBe("document.caretRangeFromPoint(400,270).startOffset", "12");
58 shouldBe("document.caretRangeFromPoint(400,211).startOffset", "12");
60 debug("To the right of the second column:");
61 shouldBe("document.caretRangeFromPoint(400,210).startOffset", "24");
62 shouldBe("document.caretRangeFromPoint(400,170).startOffset", "24");
63 shouldBe("document.caretRangeFromPoint(400,111).startOffset", "24");
65 debug("Below first column:");
66 shouldBe("document.caretRangeFromPoint(90,350).startOffset", "0");
67 shouldBe("document.caretRangeFromPoint(110,350).startOffset", "0");
68 shouldBe("document.caretRangeFromPoint(130,350).startOffset", "4");
69 shouldBe("document.caretRangeFromPoint(150,350).startOffset", "8");
70 shouldBe("document.caretRangeFromPoint(170,350).startOffset", "12");
72 debug("Above third column:");
73 shouldBe("document.caretRangeFromPoint(90,0).startOffset", "24");
74 shouldBe("document.caretRangeFromPoint(110,0).startOffset", "27");
75 shouldBe("document.caretRangeFromPoint(130,0).startOffset", "31");
76 shouldBe("document.caretRangeFromPoint(150,0).startOffset", "35");
78 debug("In the gap between the first and second columns:");
79 shouldBe("document.caretRangeFromPoint(100,211).startOffset", "3");
80 shouldBe("document.caretRangeFromPoint(120,211).startOffset", "7");
81 shouldBe("document.caretRangeFromPoint(140,211).startOffset", "11");
82 shouldBe("document.caretRangeFromPoint(159,211).startOffset", "11");
83 shouldBe("document.caretRangeFromPoint(100,210).startOffset", "12");
84 shouldBe("document.caretRangeFromPoint(120,210).startOffset", "16");
85 shouldBe("document.caretRangeFromPoint(140,210).startOffset", "20");
86 shouldBe("document.caretRangeFromPoint(159,210).startOffset", "20");
88 debug("In the gap between the second and third columns:");
89 shouldBe("document.caretRangeFromPoint(100,111).startOffset", "15");
90 shouldBe("document.caretRangeFromPoint(120,111).startOffset", "19");
91 shouldBe("document.caretRangeFromPoint(140,111).startOffset", "23");
92 shouldBe("document.caretRangeFromPoint(159,111).startOffset", "23");
93 shouldBe("document.caretRangeFromPoint(100,110).startOffset", "24");
94 shouldBe("document.caretRangeFromPoint(120,110).startOffset", "28");
95 shouldBe("document.caretRangeFromPoint(140,110).startOffset", "32");
96 shouldBe("document.caretRangeFromPoint(159,110).startOffset", "32");