Bug 1528954 [wpt PR 15461] - HTML: opener of a Window sans browsing context, a=testonly
☠☠ backed out by 66b1aba3fb43 ☠ ☠
authorAnne van Kesteren <annevk@annevk.nl>
Wed, 06 Mar 2019 12:35:03 +0000
changeset 525273 2f41234f6509a10f9ff8438bde2ec7b28f98cb76
parent 525272 4e667891d3088a94002b74336f2a6ab7933d0d21
child 525274 fff147f5ba18269e1d3d1dc1861718f42c4aefe0
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1528954, 15461
milestone67.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 1528954 [wpt PR 15461] - HTML: opener of a Window sans browsing context, a=testonly Automatic update from web-platform-tests HTML: opener of a Window sans browsing context For https://github.com/whatwg/html/pull/4379. -- wpt-commits: ad1ab06b7fcdbf7ef24cf0ed8aa13ac36d04272a wpt-pr: 15461
testing/web-platform/tests/html/browsers/windows/embedded-opener-remove-frame.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/embedded-opener-remove-frame.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<title>opener and "removed" embedded documents</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<iframe name=matchesastring></iframe>
+<script>
+async_test(t => {
+  const frame = document.querySelector("iframe"),
+        frameW = frame.contentWindow;
+  frame.onload = t.step_func(() => {
+    // Firefox and Chrome/Safari load differently
+    if (frame.contentWindow.location.href === "about:blank") {
+      return;
+    }
+
+    // Test bits
+    assert_equals(frameW.opener, window, "opener before removal");
+
+    const openerDesc = Object.getOwnPropertyDescriptor(frameW, "opener"),
+          openerGet = openerDesc.get;
+
+    assert_equals(openerGet(), window, "opener before removal via directly invoking the getter");
+    frame.remove();
+    assert_equals(frameW.opener, null, "opener after removal");
+    assert_equals(openerGet(), null, "opener after removal via directly invoking the getter");
+
+    frameW.opener = null;
+    assert_equals(openerGet(), null, "opener after setting it null via directly invoking the getter");
+    const openerDescNull = Object.getOwnPropertyDescriptor(frameW, "opener");
+    assert_not_equals(openerDescNull, openerDesc);
+    assert_object_equals(openerDescNull, openerDesc);
+
+    frameW.opener = "immaterial";
+    assert_equals(openerGet(), null, "opener after setting it \"immaterial\" via directly invoking the getter");
+    const openerDescImmaterial = Object.getOwnPropertyDescriptor(frameW, "opener");
+    assert_equals(openerDescImmaterial.value, "immaterial");
+    assert_true(openerDescImmaterial.writable);
+    assert_true(openerDescImmaterial.enumerable);
+    assert_true(openerDescImmaterial.configurable);
+
+    t.done();
+  });
+  window.open("/common/blank.html", "matchesastring");
+});
+</script>