Bug 1457447 [wpt PR 10680] - HTML: document.open() and mutation events, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Tue, 01 May 2018 17:18:05 +0000
changeset 472717 eb643115941aeb1976d8dec61f241cd627bfc195
parent 472716 3d12a72b808449110c58a51690abfdc9731b64d2
child 472718 a6b9ff483c2e6c5aebbbc0b664f61934afa61738
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1457447, 10680
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1457447 [wpt PR 10680] - HTML: document.open() and mutation events, a=testonly Automatic update from web-platform-testsHTML: document.open() and mutation events See https://github.com/whatwg/html/pull/3598. -- wpt-commits: e4b690a768b15c0b2aab558e97454385ec7164e1 wpt-pr: 10680
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -333347,16 +333347,22 @@
     ]
    ],
    "html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html": [
     [
      "/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html",
      {}
     ]
    ],
+   "html/dom/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js": [
+    [
+     "/html/dom/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.html",
+     {}
+    ]
+   ],
    "html/dom/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext.window.js": [
     [
      "/html/dom/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext.window.html",
      {}
     ]
    ],
    "html/dom/dynamic-markup-insertion/opening-the-input-stream/type-argument.window.js": [
     [
@@ -564102,16 +564108,20 @@
   "html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html": [
    "bcc6a14a9c3d116d95e72d3f057d0cd7cbffd2cb",
    "support"
   ],
   "html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html": [
    "a2a5acc9dfe53c7482eeaa4be3a4819238f8e120",
    "testharness"
   ],
+  "html/dom/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js": [
+   "1e1c656e1d19c9c459faf16327e099a4c9e13872",
+   "testharness"
+  ],
   "html/dom/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext-subframe.txt": [
    "8d06cea05d408d70c59b1dbc5df3bda374d869a4",
    "support"
   ],
   "html/dom/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext.window.js": [
    "1f440ff93300a0ab715982feb067dd3162c8fce9",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js
@@ -0,0 +1,22 @@
+// In an ideal world this test would eventually be obsolete due to mutation events disappearing. Or
+// would have to change to account for mutation events not firing synchronously. Neither seems
+// realistic to the author though.
+
+test(t => {
+  const frame = document.body.appendChild(document.createElement("iframe"));
+  frame.contentWindow.addEventListener("DOMNodeInserted", t.unreached_func());
+  frame.contentWindow.addEventListener("DOMNodeInserted", t.unreached_func(), true);
+  frame.contentWindow.addEventListener("DOMNodeInsertedIntoDocument", t.unreached_func(), true);
+  frame.contentWindow.addEventListener("DOMNodeRemoved", t.unreached_func());
+  frame.contentWindow.addEventListener("DOMNodeRemoved", t.unreached_func(), true);
+  frame.contentWindow.addEventListener("DOMNodeRemovedFromDocument", t.unreached_func(), true);
+  frame.contentWindow.addEventListener("DOMSubtreeModified", t.unreached_func());
+  frame.contentWindow.addEventListener("DOMSubtreeModified", t.unreached_func(), true);
+  assert_equals(frame.contentDocument.documentElement.localName, "html");
+  frame.contentDocument.open();
+  assert_equals(frame.contentDocument.documentElement, null);
+  frame.contentDocument.write("<div>heya</div>");
+  frame.contentDocument.close();
+  assert_equals(frame.contentDocument.documentElement.localName, "html");
+  frame.remove();
+}, "document.open(), the HTML parser, and mutation events");