4 https://bugzilla.mozilla.org/show_bug.cgi?id=1270235
7 <title>Test for Bug
1270235</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1270235">Mozilla Bug
1270235</a>
16 <div id=
"content" style=
"display: none;"></div>
18 <div id=
"edit1" contenteditable=
"true"><p>AB
</p></div>
19 <script type=
"application/javascript">
20 SimpleTest.waitForExplicitFinish();
21 SimpleTest.waitForFocus(() =
> {
22 let element = document.getElementById(
"edit1");
24 let textNode = element.firstChild.firstChild;
25 let node = textNode.splitText(
0);
28 ok(!node.parentNode,
"parent must be null");
30 let newRange = document.createRange();
31 newRange.setStart(node,
0);
32 newRange.setEnd(node,
0);
33 let selection = document.getSelection();
34 selection.removeAllRanges();
35 selection.addRange(newRange);
37 ok(selection.isCollapsed,
"isCollapsed must be true");
39 // Don't crash by user input