2 <script src=
"../../resources/ahem.js"></script>
8 /* Need a wrapper to establish the writing mode, thanks to crbug.com/
463462 */
10 -webkit-writing-mode: vertical-rl;
17 overflow: -webkit-paged-x;
18 -webkit-column-gap:
0;
20 unicode-bidi: bidi-override;
32 <p id=
"description"></p>
33 <div id=
"console"></div>
36 <div id=
"pagedContainer">xxx xxx xxx xxx xxx xxx xxx xxx xxx
</div>
38 <script src=
"../../resources/js-test.js"></script>
41 description("Test that hitting areas outside a paged container takes us to the right text content on some page.");
43 // FIXME: We should ideally test above and below every page, but we get bogus results,
44 // thanks to crbug.com/466554 , so avoid testing in the problematic areas.
46 debug("Below page 1:");
47 shouldBe("document.caretRangeFromPoint(499,320).startOffset", "0");
48 shouldBe("document.caretRangeFromPoint(430,320).startOffset", "0");
49 shouldBe("document.caretRangeFromPoint(390,320).startOffset", "4");
51 debug("Above page 1:");
52 shouldBe("document.caretRangeFromPoint(499,0).startOffset", "0");
53 shouldBe("document.caretRangeFromPoint(430,0).startOffset", "3");
54 shouldBe("document.caretRangeFromPoint(390,0).startOffset", "7");
56 debug("To the right of page 1:");
57 shouldBe("document.caretRangeFromPoint(499,320).startOffset", "0");
58 shouldBe("document.caretRangeFromPoint(499,250).startOffset", "0");
59 shouldBe("document.caretRangeFromPoint(499,0).startOffset", "0");
61 debug("Scroll to page 2");
62 document
.getElementById("pagedContainer").scrollLeft
= 120;
64 debug("Below page 2:");
65 shouldBe("document.caretRangeFromPoint(449,320).startOffset", "12");
66 shouldBe("document.caretRangeFromPoint(330,320).startOffset", "20");
68 debug("Above page 2:");
69 shouldBe("document.caretRangeFromPoint(449,0).startOffset", "15");
70 shouldBe("document.caretRangeFromPoint(330,0).startOffset", "23");
72 debug("Scroll to page 3");
73 document
.getElementById("pagedContainer").scrollLeft
= 0;
75 debug("Below page 3:");
76 shouldBe("document.caretRangeFromPoint(449,320).startOffset", "24");
77 shouldBe("document.caretRangeFromPoint(330,320).startOffset", "32");
79 debug("Above page 3:");
80 shouldBe("document.caretRangeFromPoint(449,0).startOffset", "27");
81 shouldBe("document.caretRangeFromPoint(330,0).startOffset", "35");