3 <script src=../editing.js
language=
"JavaScript" type=
"text/JavaScript" ></script>
6 testRunner
.dumpEditingCallbacks();
10 function log(message
) {
11 var console
= document
.getElementById("console");
12 var li
= document
.createElement("li");
13 var text
= document
.createTextNode(message
);
15 console
.appendChild(li
);
20 if (window
.testRunner
)
21 testRunner
.waitUntilDone();
22 // Let the subframe come into being.
23 window
.setTimeout(step2
, 100);
24 e
= document
.getElementById("dragme");
25 setSelectionCommand(e
, 0, e
, 1);
30 if (!window
.testRunner
) {
31 log("This test uses the eventSender. To run it manually, drag the selected image into the editable div and drop it. It should appear inside the editable div.");
35 log("Abe should appear twice, once inside the div and once outside it.");
37 e
= document
.getElementById("dragme");
38 x
= e
.offsetLeft
+ e
.offsetWidth
/ 2;
39 y
= e
.offsetTop
+ e
.offsetHeight
/ 2;
41 eventSender
.mouseMoveTo(x
, y
);
42 eventSender
.mouseDown();
43 e
= document
.getElementById("target");
44 x
= e
.offsetLeft
+ e
.offsetWidth
/ 2;
45 y
= e
.offsetTop
+ e
.offsetHeight
/ 2;
47 eventSender
.mouseMoveTo(x
, y
);
48 eventSender
.mouseUp();
50 testRunner
.notifyDone();
55 <body style=
"padding:0; margin:0" onload=
"runTest();">
57 <div id=
"target" style=
"border: 1px solid black; width: 300px; height: 120px;" contenteditable=
"true"></div>
58 <img id=
"dragme" src=
"../resources/abe.png">
60 <ul id=
"console"></ul>