OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 body { |
| 4 margin:0; |
| 5 } |
| 6 |
| 7 /* Need a wrapper to establish the writing mode, thanks to crbug.com/463462
*/ |
| 8 #wrapper { |
| 9 -webkit-writing-mode: vertical-rl; |
| 10 padding: 50px; |
| 11 width: 400px; |
| 12 height: 250px; |
| 13 } |
| 14 |
| 15 #pagedContainer { |
| 16 overflow: -webkit-paged-y; |
| 17 -webkit-column-gap: 0; |
| 18 direction: rtl; |
| 19 unicode-bidi: bidi-override; |
| 20 width: 150px; |
| 21 height: 200px; |
| 22 margin: 40px 100px; |
| 23 font: 40px/1 Ahem; |
| 24 } |
| 25 |
| 26 #log { |
| 27 position: absolute; |
| 28 top: 350px; |
| 29 } |
| 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 description("Test that hitting areas outside a paged container takes us to t
he right text content on some page."); |
| 41 |
| 42 // Note that this test is very limited (compared to the other caret-range- t
ests), |
| 43 // due to platform behavioral differences, and crbug.com/466974 |
| 44 |
| 45 debug("To the right of page 1:"); |
| 46 shouldBe("document.caretRangeFromPoint(360,91).startOffset", "0"); |
| 47 shouldBe("document.caretRangeFromPoint(360,150).startOffset", "0"); |
| 48 shouldBe("document.caretRangeFromPoint(360,300).startOffset", "0"); |
| 49 |
| 50 debug("Below page 1:"); |
| 51 shouldBe("document.caretRangeFromPoint(400,320).startOffset", "0"); |
| 52 shouldBe("document.caretRangeFromPoint(330,320).startOffset", "0"); |
| 53 shouldBe("document.caretRangeFromPoint(290,320).startOffset", "4"); |
| 54 shouldBe("document.caretRangeFromPoint(250,320).startOffset", "8"); |
| 55 |
| 56 debug("Scroll to page 3"); |
| 57 document.getElementById("pagedContainer").scrollTop = 0; |
| 58 |
| 59 debug("Above page 3:"); |
| 60 shouldBe("document.caretRangeFromPoint(330,0).startOffset", "27"); |
| 61 shouldBe("document.caretRangeFromPoint(290,0).startOffset", "31"); |
| 62 shouldBe("document.caretRangeFromPoint(250,0).startOffset", "35"); |
| 63 </script> |
OLD | NEW |