Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / pagination / caret-range-outside-paged-x-rtl-vertical-rl.html
blob994678084600d267ddbebdcc7daf3e328e135c43
1 <!DOCTYPE html>
2 <script src="../../resources/ahem.js"></script>
3 <style>
4 body {
5 margin:0;
8 /* Need a wrapper to establish the writing mode, thanks to crbug.com/463462 */
9 #wrapper {
10 -webkit-writing-mode: vertical-rl;
11 padding: 50px;
12 width: 400px;
13 height: 250px;
16 #pagedContainer {
17 overflow: -webkit-paged-x;
18 -webkit-column-gap: 0;
19 direction: rtl;
20 unicode-bidi: bidi-override;
21 width: 120px;
22 height: 200px;
23 font: 40px/1 Ahem;
26 #log {
27 position: absolute;
28 top: 351px;
30 </style>
31 <div id="log">
32 <p id="description"></p>
33 <div id="console"></div>
34 </div>
35 <div id="wrapper">
36 <div id="pagedContainer">xxx xxx xxx xxx xxx xxx xxx xxx xxx</div>
37 </div>
38 <script src="../../resources/js-test.js"></script>
39 <script>
40 onload = function() {
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");
83 </script>