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

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

Issue 12321005: Enable touch based selection and editing for webpages behind a flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include unittest in only chromeos builds Created 7 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
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | 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
new file mode 100644
index 0000000000000000000000000000000000000000..0c4721a98e89d80def24a0a0fed0ffb72cc3bfa5
--- /dev/null
+++ b/content/test/data/touch_selection.html
@@ -0,0 +1,35 @@
+<html>
+<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();
+}
+
+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>
+
+</html>
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698