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

Side by Side Diff: content/test/data/touch_selection.html

Issue 1740193002: Fix the coordinates for touch selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« 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
1 <html> 1 <html>
2 <style>
3 /* Add space between div and textfield so that touch selects the text in div. */
4 #textDiv {
5 margin-bottom: 30px;
6 }
7 </style>
8 <body>
9 <div id='dummy'>Dummy Padding Text</div>
2 <div id='textDiv'>Some text we can select</div> 10 <div id='textDiv'>Some text we can select</div>
11 <div id='dummy'>Dummy Padding Text</div>
12
3 <input id='textfield' type="text" value="Text in a textfield"> 13 <input id='textfield' type="text" value="Text in a textfield">
14 </body>
4 <script> 15 <script>
5 16
6 function focus_textfield() { 17 function focus_textfield() {
7 document.getElementById('textfield').focus(); 18 document.getElementById('textfield').focus();
8 // Focusing the textfiled selects its text. Collapse selection to a cursor. 19 // Focusing the textfiled selects its text. Collapse selection to a cursor.
9 window.getSelection().collapseToStart(); 20 window.getSelection().collapseToStart();
10 } 21 }
11 22
12 function get_point_inside(element) { 23 function get_point_inside(element) {
13 var rect = element.getBoundingClientRect(); 24 var rect = element.getBoundingClientRect();
(...skipping 12 matching lines...) Expand all
26 get_point_inside(document.getElementById('textfield')); 37 get_point_inside(document.getElementById('textfield'));
27 } 38 }
28 39
29 function empty_textfield() { 40 function empty_textfield() {
30 document.getElementById('textfield').value = ""; 41 document.getElementById('textfield').value = "";
31 } 42 }
32 43
33 </script> 44 </script>
34 45
35 </html> 46 </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