4 https://bugzilla.mozilla.org/show_bug.cgi?id=1102906
8 <title>Test for Bug
1102906</title>
10 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
11 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
13 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
18 /* Test for Bug 1102906 */
19 /* The caret should be movable by using keyboard after drag-and-drop. */
21 SimpleTest
.waitForExplicitFinish();
22 SimpleTest
.waitForFocus( () => {
23 let content
= document
.getElementById("content");
24 let drag
= document
.getElementById("drag");
25 let selection
= window
.getSelection();
27 /* Perform drag-and-drop for an arbitrary content. The caret should be at
28 the end of the contenteditable. */
29 selection
.selectAllChildren(drag
);
30 synthesizeDrop(drag
, content
, {}, "copy");
32 let textContentAfterDrop
= content
.textContent
;
34 /* Move the caret to the front of the contenteditable by using keyboard. */
35 for (let i
= 0; i
< content
.textContent
.length
; ++i
) {
40 is(content
.textContent
, "!" + textContentAfterDrop
,
41 "The exclamation mark should be inserted at the front.");
48 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1102906">Mozilla Bug
1102906</a>
49 <div id=
"content" contenteditable=
"true"><span id=
"drag">Drag
</span></div>