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

Unified Diff: LayoutTests/fast/multicol/vertical-rl/caret-range-outside-columns-rtl.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/multicol/vertical-rl/caret-range-outside-columns-rtl.html
diff --git a/LayoutTests/fast/multicol/vertical-rl/caret-range-outside-columns-rtl.html b/LayoutTests/fast/multicol/vertical-rl/caret-range-outside-columns-rtl.html
new file mode 100644
index 0000000000000000000000000000000000000000..e33038895c947c36825dd096a7e5c7336af0f47b
--- /dev/null
+++ b/LayoutTests/fast/multicol/vertical-rl/caret-range-outside-columns-rtl.html
@@ -0,0 +1,79 @@
+<!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: 20px 100px;
+ width: 400px;
+ height: 350px;
+ background: green;
+ }
+
+ #mc {
+ -webkit-columns: 3;
+ -webkit-column-gap: 20px;
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ height: 280px;
+ font: 20px/1 Ahem;
+ }
+
+ #log {
+ position: absolute;
+ top: 400px;
+ }
+</style>
+<div id="log">
+ <p id="description"></p>
+ <div id="console"></div>
+</div>
+<div id="wrapper">
+ <div id="mc">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 columns takes us to the right text content inside columns.");
+
+ // Note that this test is very limited (compared to the other caret-range- tests),
+ // due to platform behavioral differences, and crbug.com/466974
+
+ debug("To the right of the first column:");
+ shouldBe("document.caretRangeFromPoint(550,340).startOffset", "0");
+ shouldBe("document.caretRangeFromPoint(550,270).startOffset", "0");
+ shouldBe("document.caretRangeFromPoint(550,211).startOffset", "0");
+
+ debug("Below first column:");
+ shouldBe("document.caretRangeFromPoint(550,350).startOffset", "0");
+ shouldBe("document.caretRangeFromPoint(490,350).startOffset", "0");
+ shouldBe("document.caretRangeFromPoint(470,350).startOffset", "4");
+ shouldBe("document.caretRangeFromPoint(450,350).startOffset", "8");
+
+ debug("Above third column:");
+ shouldBe("document.caretRangeFromPoint(490,0).startOffset", "27");
+ shouldBe("document.caretRangeFromPoint(470,0).startOffset", "31");
+ shouldBe("document.caretRangeFromPoint(450,0).startOffset", "35");
+
+ debug("In the gap between the first and second columns:");
+ shouldBe("document.caretRangeFromPoint(499,211).startOffset", "3");
+ shouldBe("document.caretRangeFromPoint(479,211).startOffset", "7");
+ shouldBe("document.caretRangeFromPoint(459,211).startOffset", "11");
+ shouldBe("document.caretRangeFromPoint(440,211).startOffset", "11");
+ shouldBe("document.caretRangeFromPoint(499,210).startOffset", "12");
+ shouldBe("document.caretRangeFromPoint(479,210).startOffset", "16");
+ shouldBe("document.caretRangeFromPoint(459,210).startOffset", "20");
+ shouldBe("document.caretRangeFromPoint(440,210).startOffset", "20");
+
+ debug("In the gap between the second and third columns:");
+ shouldBe("document.caretRangeFromPoint(499,111).startOffset", "15");
+ shouldBe("document.caretRangeFromPoint(479,111).startOffset", "19");
+ shouldBe("document.caretRangeFromPoint(459,111).startOffset", "23");
+ shouldBe("document.caretRangeFromPoint(440,111).startOffset", "23");
+ shouldBe("document.caretRangeFromPoint(499,110).startOffset", "24");
+ shouldBe("document.caretRangeFromPoint(479,110).startOffset", "28");
+ shouldBe("document.caretRangeFromPoint(459,110).startOffset", "32");
+ shouldBe("document.caretRangeFromPoint(440,110).startOffset", "32");
+</script>

Powered by Google App Engine
This is Rietveld 408576698