7 document
.getElementById('console')
8 .appendChild(document
.createElement('div'))
9 .appendChild(document
.createTextNode(s
));
12 function onDragStart(e
)
14 if (e
.target
.id
== 'textInput')
17 log('FAIL: target element was ' + e
.target
);
22 document
.getElementById('draggableElement').addEventListener('dragstart', onDragStart
);
23 if (!window
.testRunner
)
25 testRunner
.dumpAsText();
27 var textInput
= document
.getElementById('textInput');
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();
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>
46 <div id=
"console"></div>