4 testRunner
.dumpAsText();
6 <div>This test checks that the plain text dropped into a styled text region will acquire the appropriate style.
</div>
7 <p>To run this test manually, drag the text in the input element below into the bold text region. The dropped text should be bold.
8 Click the verify button to check.
</p>
9 <input type=
"button" value=
"Verify" onClick=
"verifier()">
11 <input id=
"grabme" value=
"Drag this text" >
13 <b contenteditable=
"true" id=
"destination">Drag the text from the above input element into this bold text
</b>
14 <ul id=
"console"></ul>
17 function log(message
) {
18 var console
= document
.getElementById("console");
19 var li
= document
.createElement("li");
20 var pre
= document
.createElement("pre");
21 pre
.appendChild(document
.createTextNode(message
));
23 console
.appendChild(li
);
27 var textToDrag
= document
.getElementById("grabme");
30 if (!window
.testRunner
)
33 var x
= textToDrag
.offsetLeft
+ textToDrag
.offsetWidth
/ 2;
34 var y
= textToDrag
.offsetTop
+ textToDrag
.offsetHeight
/ 2;
36 eventSender
.mouseMoveTo(x
, y
);
38 eventSender
.mouseDown();
39 // Wait a moment so that the mouseDown will kick off a drag
40 eventSender
.leapForward(400);
42 var destinationObject
= document
.getElementById("destination");
43 var x
= destinationObject
.offsetLeft
+ destinationObject
.offsetWidth
/ 2;
44 var y
= destinationObject
.offsetTop
+ destinationObject
.offsetHeight
/ 2;
47 eventSender
.mouseMoveTo(x
, y
);
48 eventSender
.mouseUp();
54 log(document
.getElementById("destination").outerHTML
);
55 if (document
.getElementById("destination").childNodes
.length
== 1)