Bug 1883912: Enable Intl.ListFormat test for "unit" style. r=spidermonkey-reviewers...
[gecko.git] / editor / libeditor / tests / test_bug1247483.html
blobc8b45b4439a5ccbe4babf00c541baf113d8bdfdf
1 <!DOCTYPE HTML>
2 <html><head>
3 <title>Test for bug 1247483</title>
4 <style src="/tests/SimpleTest/test.css" type="text/css"></style>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <script src="/tests/SimpleTest/EventUtils.js"></script>
8 <script class="testbody" type="application/javascript">
10 function runTest() {
11 // Copy content from table.
12 var selection = getSelection();
13 var startRange = document.createRange();
14 startRange.setStart(document.getElementById("start"), 0);
15 startRange.setEnd(document.getElementById("end"), 2);
16 selection.removeAllRanges();
17 selection.addRange(startRange);
18 SpecialPowers.wrap(document).execCommand("copy", false, null);
20 // Paste content into "pastecontainer"
21 var pasteContainer = document.getElementById("pastecontainer");
22 var pasteRange = document.createRange();
23 pasteRange.selectNodeContents(pasteContainer);
24 pasteRange.collapse(false);
25 selection.removeAllRanges();
26 selection.addRange(pasteRange);
27 SpecialPowers.wrap(document).execCommand("paste", false, null);
29 is(pasteContainer.querySelectorAll("td").length, 4, "4 <td> should be pasted.");
31 document.execCommand("undo", false, null);
33 is(pasteContainer.querySelectorAll("td").length, 0, "Undo should have remove the 4 pasted <td>.");
35 SimpleTest.finish();
38 SimpleTest.waitForExplicitFinish();
40 addLoadEvent(runTest);
41 </script>
42 </head>
43 <body>
44 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1247483">Mozilla Bug 1247483</a>
45 <p id="display"></p>
47 <pre id="test">
48 </pre>
50 <div id="container" contenteditable="true">
51 <table>
52 <tr id="start"><td>1 1</td><td>1 2</td></tr>
53 <tr id="end"><td>2 1</td><td>2 2</td></tr>
54 </table>
55 </div>
57 <div id="pastecontainer" contenteditable="true">
58 </div>
60 </body>
61 </html>