Bug 1481906 [wpt PR 12359] - HTML: Add checks for the return value of document.open(), a=testonly
authorTimothy Gu <timothygu99@gmail.com>
Mon, 13 Aug 2018 18:26:37 +0000
changeset 486632 581b167c860ea514d14dad24b0e7644955350ed9
parent 486631 b029f3ea36f74ebccbff35741843c1cca6941ad3
child 486633 6dedec0e4c5e5e24c12696d35fc246368f57764b
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1481906, 12359
milestone63.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 1481906 [wpt PR 12359] - HTML: Add checks for the return value of document.open(), a=testonly Automatic update from web-platform-testsHTML: Add checks for the return value of document.open() -- wpt-commits: ea85edd7e7db3a08088a5951b881a83380f07154 wpt-pr: 12359
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/002.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/004.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/005.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/006.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/008.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/009.https.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011-1.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/012-1.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/013-1.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/014-1.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/015-1.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/016-1.html
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-ignore-opens-during-unload.window.js
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-synchronous-script.window.js
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/custom-element.window.js
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext.window.js
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument.window.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -603660,129 +603660,129 @@
    "0cc32be6a2368591de06759c92223941f380f9c2",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/001.html": [
    "f82d80be7b6b50608699b73a6f8d1b592e0a55c6",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/002.html": [
-   "42f6c580cae4ad5d298e7fcf62e2b9a80c3e569e",
+   "5584bf9afbff034f5ea68d769afa648e31fe1aaf",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/004-1.html": [
    "c50eddd41faba2ecc8928e459288fe612b999170",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/004.html": [
-   "f489caa72fed1c1bbf70c61160b071c6141e92bf",
+   "0b3220279fd56148a36d2085563056827702018d",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/005.html": [
-   "6bd8505203f15a32fc3f37c5b2aaf8e443dccaf2",
+   "24725b76fb1c3aeb2ab4935b3fc95589375e4a4a",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/006.html": [
-   "692d06d98fbf75ba1679162e6fc8ac008c4a5d51",
+   "ae5edc457dacd5c1a06169fa0fda96396dfc0f21",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/007.html": [
    "e5f0d1561ef6e9cd33393914e087e33fca73fefe",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/008.html": [
-   "08fd4aa43947673c69ab5b09278e8314f17d43a8",
+   "7471b2203169fd0cc74c9572a9c207dd4eb099a0",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/009.https.html": [
-   "4fc5163ea44f7177f722855beeabdac51cf3a196",
+   "3f51fa40dfa50cfaa8f6eb3b05d725255960d139",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010-1.html": [
    "317e13691d4a94e5861bbb85d7367591d7d1c624",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010-2.html": [
    "ea537fcd6018fab07cb58132a2523d82cb8783de",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010.html": [
-   "f37e8855dcfb6303a2f06ea3bea3c959998d9fd0",
+   "d83d24f2414b7f08229662694a7fd475560e2858",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011-1.html": [
-   "e12d78f4ac3c446b43a050c93a4c784a627ed090",
+   "37973fd52ec8c3b8091683e4726058ad2513c053",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011.html": [
    "2acc884c548cbf521127cfb149773950a2656322",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/012-1.html": [
-   "b1937b2f8549553bb4a33960b5c518cd1ca18054",
+   "644b30827dbb3a698d4c5aac7f2a995fd08a23b4",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/012.html": [
    "518454858de717855aca667e7f7f05244eac7931",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/013-1.html": [
-   "ed8843bbdbb27f54e707f7a296d4d137cb9652a2",
+   "ea321238ed5892b9e7a8ba7d665450e34850242f",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/013.html": [
    "5749361aa8a980c3d064696a7f89a4862efb2880",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/014-1.html": [
-   "6d04da5651cc35c5386772f11a5cf6981b69bb72",
+   "0e978081166e241baa6fc9737d10920040de54e9",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/014.html": [
    "b4e4b17cf4f88d95727d943b00515f284807c30f",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/015-1.html": [
-   "670710090e1299a91d38ae68fc080efa75151879",
+   "dffbac0c04116c67492bca5fee606e2c958afbae",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/015.html": [
    "5ef06176ba0a1f253da0afe28fc0ea68e745ec30",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/016-1.html": [
-   "17f5140ec9f924d68e5bdcf8209783ba4aa8130f",
+   "12990a560703a5fec869674b4a12027cb07292cc",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/016.html": [
    "1c70fce591a38dd7917e1fffbd1d9ebab46e8b7f",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js": [
    "1d94de8a7c9f28dfab32111deb664d9921437e46",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-ignore-opens-during-unload.window.js": [
-   "92bd74e1ff5cf6802d865d34c851dab642f1364e",
+   "98ffba20a1a17ce12881c68a736db5a81d3e3289",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-same-origin-domain.sub.window.js": [
    "ef35452e330e80ab8b4acebf4f1f9ef7a523dc90",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-synchronous-script.window.js": [
-   "6e243576c56dde277af85338a45926659f3887ac",
+   "59a750a85875b15a186073c797aa11b060539969",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-xml.window.js": [
    "b3ea1fdf75455616c0e47772b0403bf434f76d36",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/custom-element.window.js": [
-   "015df8fdc045fd22208c2d70cfa728b34febbb1e",
+   "be646d15b803d3fbe583a38d4524ad36e1a9b5d1",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml": [
    "974702ae8cbdbd45704d325d5d7e1e649535bd09",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-02.html": [
    "b56e3a836f46ebe3d902bcbcbca91ac50a6d697d",
@@ -603792,29 +603792,29 @@
    "b5252dceab6b63bed93f4c0f6fd23d61097fe7a4",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-03.html": [
    "fc325d54db239d729a4b762367576494c9e93490",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js": [
-   "a610ce9e1d175ffcf819bbd87fe897497b809280",
+   "f0d133a5329017814f21b206934a554955d15f88",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/event-listeners.window.js": [
    "97334ce1bab8f15f85361f50117106a7ac1aa782",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js": [
-   "d76ca85195491e8a75f01499683e76f311ee8636",
+   "5de4b1421b5ef10adecb10a2d5bda0d3a2c2711c",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js": [
-   "5c8e7d68e23107ddba11ab05714d7cdffeb41560",
+   "4efbb863c6372a3ee04d11f38d7ee56a44a2ac7d",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/origin-check-in-document-open-basic.html": [
    "118be71af19c88d5fed0a1efe010bbd6868eae9c",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/origin-check-in-document-open-same-origin-domain.sub.html": [
    "5e5ca80781809cc509a8eade7ea91e74de92f9a8",
@@ -603844,21 +603844,21 @@
    "a92a7ae39f8351f97cd865dca5ebe8d4260aa229",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext-subframe.txt": [
    "3e715502b971d4f8282d1e05a8ccfad6f7037910",
    "support"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext.window.js": [
-   "52edd004ff6866bf00de10d391ad0be0e62f45dc",
+   "ab1d9706a46a848f753e6ad25ad86454d92b8f1d",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument.window.js": [
-   "704130abfe91a25e26fc6d452d0981d3dc104642",
+   "9174008da33b7faeba91169efe3ace6e1dc87704",
    "testharness"
   ],
   "html/webappapis/microtask-queuing/queue-microtask-exceptions.any.js": [
    "01f32ac9ba14962fa99d4b263a8ca0f5a0daa161",
    "testharness"
   ],
   "html/webappapis/microtask-queuing/queue-microtask.any.js": [
    "b39931719a88ad525511d8f8745a9b752a6a6465",
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/002.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/002.html
@@ -1,12 +1,12 @@
 <!doctype html>
 <title>document.open during parsing</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
 test(function() {
  var log = document.getElementById("log");
- document.open()
- assert_equals(document.getElementById("log"), log)
+ assert_equals(document.open(), document);
+ assert_equals(document.getElementById("log"), log);
 })
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/004.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/004.html
@@ -6,14 +6,14 @@
 <iframe src="004-1.html"></iframe>
 <script>
 var t = async_test();
 var iframe;
 onload = t.step_func(function() {
   var iframe = document.getElementsByTagName("iframe")[0];
   var handle = iframe.contentDocument;
   iframe.contentDocument.test_state = 1;
-  iframe.contentDocument.open();
+  assert_equals(iframe.contentDocument.open(), handle);
   assert_equals(iframe.contentDocument.test_state, 1);
   assert_equals(iframe.contentDocument, handle);
   t.done();
 });
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/005.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/005.html
@@ -5,12 +5,12 @@
 <div id="log"></div>
 <iframe src="004-1.html"></iframe>
 <script>
 var t = async_test();
 var iframe;
 onload = t.step_func(function() {
   var iframe = document.getElementsByTagName("iframe")[0];
   iframe.contentWindow.setTimeout(t.step_func(function() {assert_unreached()}), 100);
-  iframe.contentDocument.open()
+  assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
   setTimeout(function() {t.done();}, 200);
 });
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/006.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/006.html
@@ -8,12 +8,12 @@
 var t = async_test();
 var iframe;
 onload = t.step_func(function() {
   var iframe = document.getElementsByTagName("iframe")[0];
   var img = iframe.contentDocument.createElement("img");
   img.onerror = t.step_func(function() {assert_unreached()})
   img.src = "missing";
   iframe.contentDocument.body.appendChild(img);
-  iframe.contentDocument.open()
+  assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
   setTimeout(function() {t.done();}, 500);
 });
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/008.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/008.html
@@ -6,15 +6,15 @@
 <iframe src="004-1.html"></iframe>
 <script>
 var t = async_test();
 var iframe;
 onload = t.step_func(function() {
   var iframe = document.getElementsByTagName("iframe")[0];
   var handle = Object.getPrototypeOf(iframe.contentDocument);
   handle.test_state = 1;
-  iframe.contentDocument.open();
+  assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
   var new_handle = Object.getPrototypeOf(iframe.contentDocument);
   assert_equals(new_handle.test_state, undefined);
   assert_not_equals(new_handle, handle);
   t.done();
 });
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/009.https.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/009.https.html
@@ -23,12 +23,12 @@ function(x) {
           assert_equals(new_handle, handle);
         }
         t.done();
       });
   }
 );
 }
 onload = function() {
-  iframe.contentDocument.open();
+  assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
   steps.forEach(function(x) {x()});
 }
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010.html
@@ -4,17 +4,17 @@
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <iframe src="010-1.html"></iframe>
 <script>
 var iframe;
 var t = async_test();
 onload = t.step_func(function() {
   iframe = document.getElementsByTagName("iframe")[0];
-  iframe.contentDocument.open();
+  assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
   iframe.contentDocument.close();
 
   iframe.contentWindow.setTimeout(t.step_func(function() {t.done();}), 500);
 
   onload = null;
 
   iframe.src = "010-2.html"
   setTimeout(t.step_func(function() {assert_unreached()}), 1000)
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011-1.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011-1.html
@@ -1,5 +1,5 @@
 <script>
-document.open()
+parent.t.step(() => { parent.assert_equals(document.open(), document); });
 setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
 document.close();
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/012-1.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/012-1.html
@@ -1,7 +1,7 @@
 <script>
 onload = parent.t.step_func(function() {
-  document.open()
+  parent.assert_equals(document.open(), document);
   setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
   document.close();
 });
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/013-1.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/013-1.html
@@ -1,7 +1,7 @@
 <script>
 addEventListener("DOMContentLoaded", parent.t.step_func(function() {
-  document.open()
+  parent.assert_equals(document.open(), document);
   setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
   document.close();
 }), false);
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/014-1.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/014-1.html
@@ -1,9 +1,9 @@
 <script>
 onload = parent.t.step_func(function() {
   setTimeout(parent.t.step_func(function() {
-    document.open()
+    parent.assert_equals(document.open(), document);
     setTimeout(parent.t.step_func(function() {parent.t.done()}), 0);
     document.close();
   }), 100)
 });
 </script>
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/015-1.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/015-1.html
@@ -1,13 +1,13 @@
 <script>
 onload = function() {
   window.test_prop = 1;
   parent.tests[0].step(function() {parent.assert_equals(test_prop, 1)});
-  document.open();
+  parent.tests[0].step(function() {parent.assert_equals(document.open(), document)});
   document.write("<script>test_prop = 2;<\/script>");
   document.close();
   parent.tests[0].step(function() {parent.assert_equals(test_prop, 1)});
   parent.tests[1].step(function() {parent.assert_equals(window.test_prop, 2)});
   parent.tests[2].step(function() {parent.assert_equals(get_this(), window)});
   parent.tests_done();
 };
 
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/016-1.html
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/016-1.html
@@ -1,14 +1,16 @@
 <script>
 window.test_prop = 1;
 </script>
 <script>
 onload = function() {
-  document.open();
+  parent.tests[0].step(function() {
+    parent.assert_equals(document.open(), document);
+  });
   document.write("<script>test_prop = 2; timeout_fired=false;<\/script>");
   document.close();
 
   setTimeout(function() {
     parent.tests[0].step(function() {
       parent.assert_equals(test_prop, 1, "Global scope from original window timeout");
       parent.assert_equals(window.test_prop, 2, "Window property from original window timeout")
     });
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-ignore-opens-during-unload.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-ignore-opens-during-unload.window.js
@@ -4,15 +4,15 @@ for (const ev of ["unload", "beforeunloa
   async_test(t => {
     const iframe = document.body.appendChild(document.createElement("iframe"));
     t.add_cleanup(() => iframe.remove());
     iframe.src = "/common/blank.html";
     iframe.onload = t.step_func(() => {
       iframe.contentWindow.addEventListener(ev, t.step_func_done(() => {
         const origURL = iframe.contentDocument.URL;
         assertDocumentIsReadyForSideEffectsTest(iframe.contentDocument, `ignore-opens-during-unload counter is greater than 0 during ${ev} event`);
-        iframe.contentDocument.open();
+        assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
         assertOpenHasNoSideEffects(iframe.contentDocument, origURL, `ignore-opens-during-unload counter is greater than 0 during ${ev} event`);
       }));
       iframe.src = "about:blank";
     });
   }, `document.open bailout should not have any side effects (ignore-opens-during-unload is greater than 0 during ${ev} event)`);
 }
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-synchronous-script.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-synchronous-script.window.js
@@ -1,13 +1,13 @@
 // META: script=resources/document-open-side-effects.js
 
 async_test(t => {
   const iframe = document.body.appendChild(document.createElement("iframe"));
   t.add_cleanup(() => iframe.remove());
   self.testSynchronousScript = t.step_func_done(() => {
     const origURL = iframe.contentDocument.URL;
     assertDocumentIsReadyForSideEffectsTest(iframe.contentDocument, "active parser whose script nesting level is greater than 0");
-    iframe.contentDocument.open();
+    assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
     assertOpenHasNoSideEffects(iframe.contentDocument, origURL, "active parser whose script nesting level is greater than 0");
   });
   iframe.src = "resources/bailout-order-synchronous-script-frame.html";
 }, "document.open bailout should not have any side effects (active parser whose script nesting level is greater than 0)");
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/custom-element.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/custom-element.window.js
@@ -11,17 +11,17 @@
 
 const noError = Symbol("no error");
 let err = noError;
 
 class CustomElement extends HTMLElement {
   constructor() {
     super();
     try {
-      document.open();
+      assert_equals(document.open(), document);
     } catch (e) {
       err = e;
     }
   }
 }
 customElements.define("custom-element", CustomElement);
 
 test(t => {
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js
@@ -1,12 +1,12 @@
 async_test(t => {
   const frame = document.body.appendChild(document.createElement("iframe"));
   frame.src = "resources/encoding-frame.html";
   frame.onload = t.step_func_done(t => {
     // Using toLowerCase() to avoid an Edge bug
     assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "precondition");
-    frame.contentDocument.open();
+    assert_equals(frame.contentDocument.open(), frame.contentDocument);
     assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "actual test");
     frame.contentDocument.close();
     assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "might as well");
   });
 }, "doucment.open() and the document's encoding");
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js
@@ -1,15 +1,15 @@
 for (const ev of ["unload", "beforeunload", "pagehide"]) {
   async_test(t => {
     const iframe = document.body.appendChild(document.createElement("iframe"));
     t.add_cleanup(() => iframe.remove());
     iframe.src = "/common/blank.html";
     iframe.onload = t.step_func(() => {
       iframe.contentWindow.addEventListener(ev, t.step_func_done(() => {
         assert_not_equals(iframe.contentDocument.childNodes.length, 0);
-        iframe.contentDocument.open();
+        assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
         assert_not_equals(iframe.contentDocument.childNodes.length, 0);
       }));
       iframe.src = "about:blank";
     });
   }, `document.open should bail out when ignore-opens-during-unload is greater than 0 during ${ev} event`);
 }
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js
@@ -8,15 +8,15 @@ test(t => {
   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.open(), frame.contentDocument);
   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");
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument-plaintext.window.js
@@ -7,17 +7,17 @@
  "application/octet-stream",
  "\0"].forEach(type => {
   async_test(t => {
     const frame = document.createElement("iframe");
     frame.src = "type-argument-plaintext-subframe.txt";
     document.body.appendChild(frame);
     t.add_cleanup(() => frame.remove());
     frame.onload = t.step_func_done(() => {
-      frame.contentDocument.open(type);
+      assert_equals(frame.contentDocument.open(type), frame.contentDocument);
       frame.contentDocument.write("<B>heya</b>");
       frame.contentDocument.close();
       assert_equals(frame.contentDocument.body.firstChild.localName, "b");
       assert_equals(frame.contentDocument.body.textContent, "heya");
       assert_equals(frame.contentDocument.contentType, "text/plain");
     });
   }, "document.open() on plaintext document with type set to: " + type + " (type argument is supposed to be ignored)");
 });
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument.window.js
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/type-argument.window.js
@@ -4,17 +4,17 @@
  "it does not matter, you see \f",
  "text/plain",
  "text/xml",
  "application/octet-stream",
  "\0"].forEach(type => {
   async_test(t => {
     const frame = document.body.appendChild(document.createElement("iframe"));
     t.add_cleanup(() => frame.remove());
-    frame.contentDocument.open(type);
+    assert_equals(frame.contentDocument.open(type), frame.contentDocument);
     frame.contentDocument.write("<B>heya</b>");
     frame.contentDocument.close();
     assert_equals(frame.contentDocument.body.firstChild.localName, "b");
     assert_equals(frame.contentDocument.body.textContent, "heya");
     assert_equals(frame.contentDocument.contentType, "text/html");
     t.done();
   }, "document.open() with type set to: " + type + " (type argument is supposed to be ignored)");
 });