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

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

Issue 698253004: Reland: Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased after blink issue fixed: r200194 Created 5 years, 4 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 89d768316132ec07618d91eb3c6cb913d1d1c61e..7bf8644862650a51d0396674d13aa76b771275fe 100644
--- a/content/test/data/touch_selection.html
+++ b/content/test/data/touch_selection.html
@@ -3,33 +3,27 @@
<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();
// Focusing the textfiled selects its text. Collapse selection to a cursor.
window.getSelection().collapseToStart();
}
-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;
+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'));
}
</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