Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: LayoutTests/fast/pagination/caret-range-outside-paged-x-rtl-vertical-rl.html

Issue 978603003: [New Multicolumn] Make positionForPoint() work. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More tests Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698