summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/tests/test_bug1306532.html
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2018-04-16 08:24:14 -0400
committerGitHub <noreply@github.com>2018-04-16 08:24:14 -0400
commita66e6546c361d238b0179af18e26bf18aa4a7eb9 (patch)
treeadd968413c1d17d58ae0835b7051b7d38e4648f3 /editor/libeditor/tests/test_bug1306532.html
parentded797b8bb211a2e5591d4b7d21c017a7c23b67b (diff)
parent05bb04a6514d2e6557dc0697c34a56cfd2c399a4 (diff)
downloadUXP-a66e6546c361d238b0179af18e26bf18aa4a7eb9.tar
UXP-a66e6546c361d238b0179af18e26bf18aa4a7eb9.tar.gz
UXP-a66e6546c361d238b0179af18e26bf18aa4a7eb9.tar.lz
UXP-a66e6546c361d238b0179af18e26bf18aa4a7eb9.tar.xz
UXP-a66e6546c361d238b0179af18e26bf18aa4a7eb9.zip
Merge pull request #173 from janekptacijarabaci/html_table_editor_contenteditable_1
moebius#190: HTML - table - editor (contenteditable) - post process node array to remove all descendants of replacement node
Diffstat (limited to 'editor/libeditor/tests/test_bug1306532.html')
-rw-r--r--editor/libeditor/tests/test_bug1306532.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/editor/libeditor/tests/test_bug1306532.html b/editor/libeditor/tests/test_bug1306532.html
new file mode 100644
index 000000000..1d7b3e7af
--- /dev/null
+++ b/editor/libeditor/tests/test_bug1306532.html
@@ -0,0 +1,64 @@
+<!DOCTYPE HTML>
+<html><head>
+<title>Test for bug 1306532</title>
+<style src="/tests/SimpleTest/test.css" type="text/css"></style>
+<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+
+<script class="testbody" type="application/javascript">
+
+function runTest() {
+ // Copy content from table.
+ var selection = getSelection();
+ var startRange = document.createRange();
+ startRange.setStart(headingone, 0);
+ startRange.setEnd(celltwo, 0);
+ selection.removeAllRanges();
+ selection.addRange(startRange);
+ SpecialPowers.wrap(document).execCommand("copy", false, null);
+
+ // Paste content into "pasteframe"
+ var pasteContainer = pasteframe.contentDocument.body;
+ var pasteRange = pasteframe.contentDocument.createRange();
+ pasteRange.selectNodeContents(pasteContainer);
+ pasteRange.collapse(false);
+ selection.removeAllRanges();
+ selection.addRange(pasteRange);
+ SpecialPowers.wrap(pasteframe.contentDocument).execCommand("paste", false, null);
+
+ is(pasteContainer.querySelector("#headingone").textContent, "Month", "First heading should be 'Month'.");
+ is(pasteContainer.querySelector("#headingtwo").textContent, "Savings", "Second heading should be 'Savings'.");
+ is(pasteContainer.querySelector("#cellone").textContent, "January", "First cell should be 'January'.");
+ is(pasteContainer.querySelector("#celltwo").textContent, "$100", "Second cell should be '$100'.");
+
+ SimpleTest.finish();
+}
+
+SimpleTest.waitForExplicitFinish();
+
+</script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1306532">Mozilla Bug 1306532</a>
+<p id="display"></p>
+
+<pre id="test">
+</pre>
+
+<div id="container">
+<table border="1">
+ <tr>
+ <th id="headingone">Month</th>
+ <th id="headingtwo">Savings</th>
+ </tr>
+ <tr>
+ <td id="cellone">January</td>
+ <td id="celltwo">$100</td>
+ </tr>
+</table>
+</div>
+
+<iframe onload="runTest();" id="pasteframe" src="data:text/html,<html><body contenteditable='true'>"></iframe>
+
+</body>
+</html>