Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / pagination / caret-range-outside-paged-y.html
blob4f407a0432612a96e2c688a51bc2a00b3ed6f8c3
1 <!DOCTYPE html>
2 <script src="../../resources/ahem.js"></script>
3 <style>
4 body {
5 margin:0;
8 #pagedContainer {
9 overflow: -webkit-paged-y;
10 -webkit-column-gap: 0;
11 width: 200px;
12 height: 120px;
13 margin: 40px 100px;
14 font: 40px/1 Ahem;
17 #log {
18 position: absolute;
19 top: 141px;
21 </style>
22 <div id="log">
23 <p id="description"></p>
24 <div id="console"></div>
25 </div>
26 <div id="pagedContainer">xxx xxx xxx xxx xxx xxx xxx xxx xxx</div>
27 <script src="../../resources/js-test.js"></script>
28 <script>
29 onload = function() {
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("Above page 1:");
36 shouldBe("document.caretRangeFromPoint(50,0).startOffset", "0");
37 shouldBe("document.caretRangeFromPoint(150,0).startOffset", "0");
38 shouldBe("document.caretRangeFromPoint(300,0).startOffset", "0");
40 debug("To the left of page 1:");
41 shouldBe("document.caretRangeFromPoint(0,20).startOffset", "0");
42 shouldBe("document.caretRangeFromPoint(0,60).startOffset", "0");
43 shouldBe("document.caretRangeFromPoint(0,100).startOffset", "4");
44 shouldBe("document.caretRangeFromPoint(0,140).startOffset", "8");
46 debug("To the right of page 1:");
47 shouldBe("document.caretRangeFromPoint(400,20).startOffset", "0");
48 shouldBe("document.caretRangeFromPoint(400,60).startOffset", "3");
49 shouldBe("document.caretRangeFromPoint(400,100).startOffset", "7");
50 shouldBe("document.caretRangeFromPoint(400,140).startOffset", "11");
52 debug("Scroll to page 2");
53 document.getElementById("pagedContainer").scrollTop = 120;
55 debug("To the left of page 2:");
56 shouldBe("document.caretRangeFromPoint(0,60).startOffset", "12");
57 shouldBe("document.caretRangeFromPoint(0,100).startOffset", "16");
58 shouldBe("document.caretRangeFromPoint(0,140).startOffset", "20");
60 debug("To the right of page 2:");
61 shouldBe("document.caretRangeFromPoint(400,60).startOffset", "15");
62 shouldBe("document.caretRangeFromPoint(400,100).startOffset", "19");
63 shouldBe("document.caretRangeFromPoint(400,140).startOffset", "23");
65 debug("Scroll to page 3");
66 document.getElementById("pagedContainer").scrollTop = 240;
68 debug("To the left of page 3:");
69 shouldBe("document.caretRangeFromPoint(0,60).startOffset", "24");
70 shouldBe("document.caretRangeFromPoint(0,100).startOffset", "28");
71 shouldBe("document.caretRangeFromPoint(0,140).startOffset", "32");
73 debug("To the right of page 3:");
74 shouldBe("document.caretRangeFromPoint(400,60).startOffset", "27");
75 shouldBe("document.caretRangeFromPoint(400,100).startOffset", "31");
76 shouldBe("document.caretRangeFromPoint(400,140).startOffset", "35");
78 </script>