4 <p id=
"description">This tests to see if an editable selection containing a focusable node is draggable by content inside that focusable node. To achieve this we delay focus of such nodes until mouse up. Below, the table should be inside the red bordered div.
</p>
6 <div id=
"div" contenteditable=
"true" style=
"border: 1px solid blue;">
7 <table contenteditable=
"false" border=
"1"><tr><td id=
"cell" contenteditable=
"true">editable
</td></tr></table>
9 <div id=
"destination" contenteditable=
"true" style=
"border: 1px solid red;"><br></div>
10 <ul id=
"console"></ul>
12 <script src=
"../../resources/dump-as-markup.js"></script>
15 var text
= document
.createTextNode(str
);
16 var li
= document
.createElement("li");
17 var console
= document
.getElementById("console");
18 console
.appendChild(li
);
22 if (!window
.testRunner
)
24 var cell
= document
.getElementById("cell");
25 var div
= document
.getElementById("div");
27 document
.execCommand("SelectAll");
30 x
= cell
.offsetParent
.offsetLeft
+ cell
.offsetLeft
+ cell
.offsetWidth
/ 2;
31 y
= cell
.offsetParent
.offsetTop
+ cell
.offsetTop
+ cell
.offsetHeight
/ 2;
32 eventSender
.mouseMoveTo(x
, y
);
33 eventSender
.mouseDown();
34 eventSender
.leapForward(1000);
36 var destination
= document
.getElementById("destination");
37 x
= destination
.offsetParent
.offsetLeft
+ destination
.offsetLeft
+ destination
.offsetWidth
/ 2;
38 y
= destination
.offsetParent
.offsetTop
+ destination
.offsetTop
+ destination
.offsetHeight
/ 2;
39 eventSender
.mouseMoveTo(x
, y
);
40 eventSender
.mouseUp();
41 Markup
.description(description
.textContent
);