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

Unified Diff: LayoutTests/accessibility/editable-selected-range.html

Issue 1056763002: Reland: Made content editables report the caret and text selection by treating them as text controls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merged with master. Created 5 years, 8 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/accessibility/editable-selected-range.html
diff --git a/LayoutTests/accessibility/editable-selected-range.html b/LayoutTests/accessibility/editable-selected-range.html
new file mode 100644
index 0000000000000000000000000000000000000000..9fe7fe465381bd2651c9c9980ad076b57c264325
--- /dev/null
+++ b/LayoutTests/accessibility/editable-selected-range.html
@@ -0,0 +1,37 @@
+<html>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+<body>
+
+ <div id="result"></div>
+
+ <textarea name="area1" id="area1" rows="5" cols="40">
+line 1
+line 2
+line 3
+ </textarea>
+
+ <script>
+ if (window.accessibilityController) {
+ var result = document.getElementById("result");
+
+ var area1 = document.getElementById("area1");
+ area1.focus();
+
+ var textArea = accessibilityController.focusedElement;
+
+ textArea.setSelectedTextRange(4,0);
+ result.innerText += "(4,0) = " + textArea.selectedTextRange + "\n\n";
+
+ textArea.setSelectedTextRange(8,2);
+ result.innerText += "(8,2) = " + textArea.selectedTextRange + "\n\n";
+
+ textArea.setSelectedTextRange(100,0);
+ result.innerText += "(100,0) = " + textArea.selectedTextRange + "\n\n";
+
+ }
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698