2 <script src=
"../../resources/ahem.js"></script>
9 overflow: -webkit-paged-x;
10 -webkit-column-gap:
0;
23 <p id=
"description"></p>
24 <div id=
"console"></div>
26 <div id=
"pagedContainer">xxx xxx xxx xxx xxx xxx xxx xxx xxx
</div>
27 <script src=
"../../resources/js-test.js"></script>
30 description("Test that hitting areas outside a paged container takes us to the right text content on some page.");
32 // FIXME: We should ideally test above and below every page, but we get bogus results,
33 // thanks to crbug.com/466554 , so avoid testing in the problematic areas.
35 debug("To the left of page 1:");
36 shouldBe("document.caretRangeFromPoint(0,20).startOffset", "0");
37 shouldBe("document.caretRangeFromPoint(0,60).startOffset", "0");
38 shouldBe("document.caretRangeFromPoint(0,100).startOffset", "4");
40 debug("Above page 1:");
41 shouldBe("document.caretRangeFromPoint(80,0).startOffset", "0");
42 shouldBe("document.caretRangeFromPoint(200,0).startOffset", "0");
43 shouldBe("document.caretRangeFromPoint(299,0).startOffset", "0");
45 debug("Below page 1:");
46 shouldBe("document.caretRangeFromPoint(80,200).startOffset", "12");
47 shouldBe("document.caretRangeFromPoint(200,200).startOffset", "12");
48 shouldBe("document.caretRangeFromPoint(299,200).startOffset", "12");
50 debug("Scroll to page 2");
51 document
.getElementById("pagedContainer").scrollLeft
= 200;
53 debug("Above page 2:");
54 shouldBe("document.caretRangeFromPoint(200,0).startOffset", "12");
55 shouldBe("document.caretRangeFromPoint(299,0).startOffset", "12");
57 debug("Below page 2:");
58 shouldBe("document.caretRangeFromPoint(200,200).startOffset", "24");
59 shouldBe("document.caretRangeFromPoint(299,200).startOffset", "24");
61 debug("Scroll to page 3");
62 document
.getElementById("pagedContainer").scrollLeft
= 400;
64 debug("Above page 3:");
65 shouldBe("document.caretRangeFromPoint(200,0).startOffset", "24");
66 shouldBe("document.caretRangeFromPoint(299,0).startOffset", "24");
68 debug("To the right of page 3:");
69 shouldBe("document.caretRangeFromPoint(400,20).startOffset", "24");
70 shouldBe("document.caretRangeFromPoint(400,60).startOffset", "27");
71 shouldBe("document.caretRangeFromPoint(400,100).startOffset", "31");
72 shouldBe("document.caretRangeFromPoint(400,140).startOffset", "35");