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

Unified Diff: content/test/data/touch_selection.html

Issue 1263703004: Revert of Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « content/test/BUILD.gn ('k') | ui/touch_selection/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/touch_selection.html
diff --git a/content/test/data/touch_selection.html b/content/test/data/touch_selection.html
index 7bf8644862650a51d0396674d13aa76b771275fe..89d768316132ec07618d91eb3c6cb913d1d1c61e 100644
--- a/content/test/data/touch_selection.html
+++ b/content/test/data/touch_selection.html
@@ -2,6 +2,19 @@
<div id='textDiv'>Some text we can select</div>
<input id='textfield' type="text" value="Text in a textfield">
<script>
+
+function select_all_text() {
+ var div = document.getElementById("textDiv");
+ var range = document.createRange();
+ range.selectNodeContents(div);
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+}
+
+function get_selection() {
+ return (window.getSelection() + "");
+}
function focus_textfield() {
document.getElementById("textfield").focus();
@@ -9,21 +22,14 @@
window.getSelection().collapseToStart();
}
-function get_point_inside(element) {
- var rect = element.getBoundingClientRect();
- var point = {
- x: rect.left + 8,
- y: (rect.top + rect.bottom) / 2
- };
- window.domAutomationController.send(JSON.stringify(point));
-}
-
-function get_point_inside_text() {
- get_point_inside(document.getElementById('textDiv'));
-}
-
-function get_point_inside_textfield() {
- get_point_inside(document.getElementById('textfield'));
+function get_cursor_position() {
+ var div = document.getElementById("textfield");
+ var start = div.selectionStart;
+ var end = div.selectionEnd;
+ if (start == end)
+ return start;
+ else
+ return -1;
}
</script>
« no previous file with comments | « content/test/BUILD.gn ('k') | ui/touch_selection/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698