Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / test / data / touch_selection.html
blob7bf8644862650a51d0396674d13aa76b771275fe
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>
6 function focus_textfield() {
7 document.getElementById("textfield").focus();
8 // Focusing the textfiled selects its text. Collapse selection to a cursor.
9 window.getSelection().collapseToStart();
12 function get_point_inside(element) {
13 var rect = element.getBoundingClientRect();
14 var point = {
15 x: rect.left + 8,
16 y: (rect.top + rect.bottom) / 2
18 window.domAutomationController.send(JSON.stringify(point));
21 function get_point_inside_text() {
22 get_point_inside(document.getElementById('textDiv'));
25 function get_point_inside_textfield() {
26 get_point_inside(document.getElementById('textfield'));
29 </script>
31 </html>