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

Unified Diff: LayoutTests/editing/selection/caret-in-textarea-auto.html

Issue 302433015: Use correct offset when attribute auto is present (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Position trying to look in multiple level for direction auto Created 6 years, 7 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/editing/selection/caret-in-textarea-auto.html
diff --git a/LayoutTests/editing/selection/caret-in-textarea-auto.html b/LayoutTests/editing/selection/caret-in-textarea-auto.html
new file mode 100644
index 0000000000000000000000000000000000000000..de06857b3028440805019198d0f62c718702d3a5
--- /dev/null
+++ b/LayoutTests/editing/selection/caret-in-textarea-auto.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<body>
esprehn 2014/06/04 18:02:03 We usually leave off the <html>, <head> and <body>
+<script src="../../resources/js-test.js"></script>
+<textarea id="textarea" dir="auto" style="font-size: 20px; width: 20ex; border: solid thin black; padding: 10px;">&#x05d0;!</textarea>
+<script>
+description('Test caret position in a textarea with direction auto and having RTL text. When entering a LTR text caret position is changed.');
+var textarea = document.getElementById('textarea');
+textarea.focus();
+var caretRect = textInputController.firstRectForCharacterRange(0, 0);
+shouldBe('caretRect[0]', '198');
+shouldBe('caretRect[1]', '101');
+
+window.testRunner.execCommand('MoveToEndOfLine');
+document.execCommand('InsertLineBreak');
+document.execCommand('InsertText', false, 'hello!');
+caretRect = textInputController.firstRectForCharacterRange(1, 0);
+shouldBe('caretRect[0]', '187');
+shouldBe('caretRect[1]', '133');
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/selection/caret-in-textarea-auto-expected.txt » ('j') | Source/core/dom/Position.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698