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

Side by Side Diff: LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element.html

Issue 50433002: Fix dragging text inside a input element nested in a draggable element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Better names and comments Created 7 years, 1 month 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 | « no previous file | LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function log(s)
6 {
7 document.getElementById('console')
8 .appendChild(document.createElement('div'))
9 .appendChild(document.createTextNode(s));
10 }
11
12 function onDragStart(e)
13 {
14 if (e.target.id == 'textInput')
15 log('PASS');
16 else
17 log('FAIL: target element was ' + e.target);
18 }
19
20 function runTest()
21 {
22 document.getElementById('draggableElement').addEventListener('dragstart', on DragStart);
23 if (!window.testRunner)
24 return;
25 testRunner.dumpAsText();
26
27 var textInput = document.getElementById('textInput');
28 textInput.focus();
29 textInput.select();
30 var startX = textInput.offsetLeft + textInput.offsetWidth / 2;
31 var startY = textInput.offsetTop + textInput.offsetHeight / 2;
32 eventSender.mouseMoveTo(startX, startY);
33 eventSender.mouseDown();
34 eventSender.leapForward(200);
35 eventSender.mouseMoveTo(startX + 100, startY + 100);
36 eventSender.mouseUp();
37 }
38 </script>
39 </head>
40 <body onload="runTest()">
41 <p>Simple test that dragging selected text in an input box nested in a draggable element works.
42 <div id="draggableElement" draggable="true">
43 Draggable div wrapping a text input box:
44 <input id="textInput" type="text" value="Select and drag me"></input>
45 </div>
46 <div id="console"></div>
47 </body>
48 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698