Index: LayoutTests/fast/pagination/caret-range-outside-paged-x-rtl-vertical-rl.html |
diff --git a/LayoutTests/fast/pagination/caret-range-outside-paged-x-rtl-vertical-rl.html b/LayoutTests/fast/pagination/caret-range-outside-paged-x-rtl-vertical-rl.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..20dec33d508a92e5a2a0416d5adfb64d276155f9 |
--- /dev/null |
+++ b/LayoutTests/fast/pagination/caret-range-outside-paged-x-rtl-vertical-rl.html |
@@ -0,0 +1,80 @@ |
+<!DOCTYPE html> |
+<style> |
+ body { |
+ margin:0; |
+ } |
+ |
+ /* Need a wrapper to establish the writing mode, thanks to crbug.com/463462 */ |
+ #wrapper { |
+ -webkit-writing-mode: vertical-rl; |
+ padding: 50px; |
+ width: 400px; |
+ height: 250px; |
+ } |
+ |
+ #pagedContainer { |
+ overflow: -webkit-paged-x; |
+ -webkit-column-gap: 0; |
+ direction: rtl; |
+ unicode-bidi: bidi-override; |
+ width: 120px; |
+ height: 200px; |
+ font: 40px/1 Ahem; |
+ } |
+ |
+ #log { |
+ position: absolute; |
+ top: 351px; |
+ } |
+</style> |
+<div id="log"> |
+ <p id="description"></p> |
+ <div id="console"></div> |
+</div> |
+<div id="wrapper"> |
+ <div id="pagedContainer">xxx xxx xxx xxx xxx xxx xxx xxx xxx</div> |
+</div> |
+<script src="../../resources/js-test.js"></script> |
+<script> |
+ description("Test that hitting areas outside a paged container takes us to the right text content on some page."); |
+ |
+ // FIXME: We should ideally test above and below every page, but we get bogus results, |
+ // thanks to crbug.com/466554 , so avoid testing in the problematic areas. |
+ |
+ debug("Below page 1:"); |
+ shouldBe("document.caretRangeFromPoint(499,320).startOffset", "0"); |
+ shouldBe("document.caretRangeFromPoint(430,320).startOffset", "0"); |
+ shouldBe("document.caretRangeFromPoint(390,320).startOffset", "4"); |
+ |
+ debug("Above page 1:"); |
+ shouldBe("document.caretRangeFromPoint(499,0).startOffset", "0"); |
+ shouldBe("document.caretRangeFromPoint(430,0).startOffset", "3"); |
+ shouldBe("document.caretRangeFromPoint(390,0).startOffset", "7"); |
+ |
+ debug("To the right of page 1:"); |
+ shouldBe("document.caretRangeFromPoint(499,320).startOffset", "0"); |
+ shouldBe("document.caretRangeFromPoint(499,250).startOffset", "0"); |
+ shouldBe("document.caretRangeFromPoint(499,0).startOffset", "0"); |
+ |
+ debug("Scroll to page 2"); |
+ document.getElementById("pagedContainer").scrollLeft = 120; |
+ |
+ debug("Below page 2:"); |
+ shouldBe("document.caretRangeFromPoint(449,320).startOffset", "12"); |
+ shouldBe("document.caretRangeFromPoint(330,320).startOffset", "20"); |
+ |
+ debug("Above page 2:"); |
+ shouldBe("document.caretRangeFromPoint(449,0).startOffset", "15"); |
+ shouldBe("document.caretRangeFromPoint(330,0).startOffset", "23"); |
+ |
+ debug("Scroll to page 3"); |
+ document.getElementById("pagedContainer").scrollLeft = 0; |
+ |
+ debug("Below page 3:"); |
+ shouldBe("document.caretRangeFromPoint(449,320).startOffset", "24"); |
+ shouldBe("document.caretRangeFromPoint(330,320).startOffset", "32"); |
+ |
+ debug("Above page 3:"); |
+ shouldBe("document.caretRangeFromPoint(449,0).startOffset", "27"); |
+ shouldBe("document.caretRangeFromPoint(330,0).startOffset", "35"); |
+</script> |