3 https://bugzilla.mozilla.org/show_bug.cgi?id=1409520
7 <title>Test for Bug
1409520</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1409520">Mozilla Bug
1409520</a>
14 <div id=
"content" style=
"display: none;">
18 <li contenteditable
id=
"editor">
19 <select><option>option1
</option></select>
24 <script class=
"testbody" type=
"application/javascript">
25 SimpleTest.waitForExplicitFinish();
26 SimpleTest.waitForFocus(function() {
27 var selection = window.getSelection();
28 var editor = document.getElementById(
"editor");
30 selection.collapse(editor,
0);
31 document.execCommand(
"insertText", false,
"A");
32 is(editor.firstChild.textContent,
"A",
33 "'A' should be inserted at start of the editor");
34 is(editor.firstChild.nextSibling.tagName,
"SELECT",
35 "<select> element shouldn't be removed by inserting 'A'");
36 is(selection.getRangeAt(
0).startContainer, editor.firstChild,
37 "Caret should be moved after 'A'");
38 is(selection.getRangeAt(
0).startOffset,
1,
39 "Caret should be moved after 'A'");