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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <div id='textDiv'>Some text we can select</div>
3 <input id='textfield' type="text" value="Text in a textfield">
4 <script>
5
6 function select_all_text() {
7 var div = document.getElementById("textDiv");
8 var range = document.createRange();
9 range.selectNodeContents(div);
10 var sel = window.getSelection();
11 sel.removeAllRanges();
12 sel.addRange(range);
13 }
14
15 function get_selection() {
16 return (window.getSelection() + "");
17 }
18
19 function focus_textfield() {
20 document.getElementById("textfield").focus();
21 }
22
23 function get_cursor_position() {
24 var div = document.getElementById("textfield");
25 var start = div.selectionStart;
26 var end = div.selectionEnd;
27 if (start == end)
28 return start;
29 else
30 return -1;
31 }
32
33 </script>
34
35 </html>
OLDNEW
« 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