summaryrefslogtreecommitdiffstats
path: root/dom/base/test/mutationobserver_dialog.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/base/test/mutationobserver_dialog.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/base/test/mutationobserver_dialog.html')
-rw-r--r--dom/base/test/mutationobserver_dialog.html62
1 files changed, 62 insertions, 0 deletions
diff --git a/dom/base/test/mutationobserver_dialog.html b/dom/base/test/mutationobserver_dialog.html
new file mode 100644
index 000000000..2cc815309
--- /dev/null
+++ b/dom/base/test/mutationobserver_dialog.html
@@ -0,0 +1,62 @@
+<html>
+ <head>
+ <title></title>
+ <script>
+
+ var div = document.createElement("div");
+
+ var M;
+ if ("MozMutationObserver" in window) {
+ M = window.MozMutationObserver;
+ } else if ("WebKitMutationObserver" in window) {
+ M = window.WebKitMutationObserver;
+ } else {
+ M = window.MutationObserver;
+ }
+
+ var didCall1 = false;
+ var didCall2 = false;
+ function testMutationObserverInDialog() {
+ div.innerHTML = "<span>1</span><span>2</span>";
+ m = new M(function(records, observer) {
+ opener.is(records[0].type, "childList", "Should have got childList");
+ opener.is(records[0].removedNodes.length, 2, "Should have got removedNodes");
+ opener.is(records[0].addedNodes.length, 1, "Should have got addedNodes");
+ observer.disconnect();
+ m = null;
+ didCall1 = true;
+ });
+ m.observe(div, { childList: true });
+ div.innerHTML = "<span><span>foo</span></span>";
+ }
+
+ function testMutationObserverInDialog2() {
+ div.innerHTML = "<span>1</span><span>2</span>";
+ m = new M(function(records, observer) {
+ opener.is(records[0].type, "childList", "Should have got childList");
+ opener.is(records[0].removedNodes.length, 2, "Should have got removedNodes");
+ opener.is(records[0].addedNodes.length, 1, "Should have got addedNodes");
+ observer.disconnect();
+ m = null;
+ didCall2 = true;
+ });
+ m.observe(div, { childList: true });
+ div.innerHTML = "<span><span>foo</span></span>";
+ }
+
+ window.addEventListener("load", testMutationObserverInDialog);
+ window.addEventListener("load", testMutationObserverInDialog2);
+ window.addEventListener("load",
+ function() {
+ opener.ok(didCall1, "Should have called 1st mutation callback");
+ opener.ok(didCall2, "Should have called 2nd mutation callback");
+ window.close();
+ });
+ </script>
+ <style>
+ </style>
+ </head>
+ <body>
+ <input type="button" onclick="window.close()" value="close">
+ </body>
+</html>