4 https://bugzilla.mozilla.org/show_bug.cgi?id=1268736
7 <title>Test for Bug
1268736</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=1268736">Mozilla Bug
1268736</a>
14 <table id=
"table" border=
"1" width=
"100%">
23 <td id=
"cell_readonly">e
</td>
24 <td contenteditable=
"true" id=
"cell_writable">f
</td>
29 <script type=
"application/javascript">
32 * Test for Bug
1268736
34 * Tests for editing a table cell's contents when the table cell is or isn't a child of a contenteditable node.
38 function getEditor() {
39 const Ci = SpecialPowers.Ci;
40 var editingSession = SpecialPowers.wrap(window).docShell.editingSession;
41 return editingSession.getEditorForWindow(window).QueryInterface(Ci.nsITableEditor);
44 var table = document.getElementById(
"table");
45 var tableHTML = table.innerHTML;
46 var editor = getEditor();
48 var cell = document.getElementById(
"cell_readonly");
50 editor.deleteTableCellContents();
51 is(table.innerHTML == tableHTML, true,
"editor should not modify non-editable table cell" );
53 cell = document.getElementById(
"cell_writable");
55 editor.deleteTableCellContents();
56 is(cell.innerHTML ==
"<br>", true,
"editor can modify editable table cells" );