3 <title>Test for bug
456244</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
8 <script class=
"testbody" type=
"application/javascript">
11 var e = document.getElementById(id);
16 function setupIframe(id) {
17 var e = document.getElementById(id);
18 var doc = e.contentDocument;
19 doc.body.innerHTML = String.fromCharCode(
10) + '
<span id=
"' + id + '_span" style=
"border:1px solid blue" contenteditable=
"true">X
</span>' + String.fromCharCode(
10);
20 e = doc.getElementById(id +
"_span");
25 function test_end_bs(e) {
26 const msg =
"Deleting all text in contenteditable inline element";
27 var before = e.parentNode.childNodes[
0].nodeValue;
29 sendKey(
"back_space");
30 sendKey(
"back_space");
31 is(e.parentNode.childNodes[
0].nodeValue, before, msg +
" with id=" + e.id);
32 is(e.innerHTML,
"", msg +
" with id=" + e.id);
35 test_end_bs(select(
"t1"));
36 test_end_bs(setupIframe(
"i1",
0));
39 const msg =
"Deleting all text in contenteditable body element";
40 var e = document.getElementById(
"i2");
41 var doc = e.contentDocument;
42 doc.body.setAttribute(
"contenteditable",
"true");
45 sendKey(
"back_space");
46 is(doc.body.innerHTML,
"<br>", msg +
" with id=" + e.id);
52 SimpleTest.waitForExplicitFinish();
53 addLoadEvent(runTest);
57 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=456244">Mozilla Bug
456244</a>
63 <div> <span id=
"t1" style=
"border:1px solid blue" contenteditable=
"true">X
</span> Y
</div>
65 <iframe id=
"i1" width=
"200" height=
"100" src=
"about:blank"></iframe><br>
66 <iframe id=
"i2" width=
"200" height=
"100" src=
"about:blank">X
</iframe><br>