4 https://bugzilla.mozilla.org/show_bug.cgi?id=857487
7 <title>Test for Bug
857487</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
10 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=857487">Mozilla Bug
857487</a>
14 <div id=
"edit" contenteditable=
"true">
15 <table id=
"table" border=
"1" width=
"100%">
35 <script type=
"application/javascript">
40 * Tests that removing a table row through nsIHTMLEditor works
43 function getEditor() {
44 const Ci = SpecialPowers.Ci;
45 var editingSession = SpecialPowers.wrap(window).docShell.editingSession;
46 return editingSession.getEditorForWindow(window).QueryInterface(Ci.nsITableEditor);
49 var cell = document.getElementById(
"cell");
52 // place caret at end of center cell
53 var sel = getSelection();
54 sel.collapse(cell, cell.childNodes.length);
56 var editor = getEditor();
57 editor.deleteTableRow(
1);
59 var table = document.getElementById(
"table");
61 is(table.innerHTML ==
"\n <tbody>\n <tr>\n <td>a</td>\n <td>b</td>\n <td>c</td>\n </tr>\n \n <tr>\n <td>g</td>\n <td>h</td>\n <td>i</td>\n </tr>\n </tbody>\n ",
62 true,
"editor.deleteTableRow(1) should delete the row containing the selection");