Bug 1529726 [wpt PR 15414] - HTML: window.length and named access, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Tue, 05 Mar 2019 12:18:39 +0000
changeset 464249 3d06a920925d1d2beb8dbe5d3fb7a686155a7000
parent 464248 22f687c325e863a47fc71f353b158de9043103ab
child 464250 e860533a47432d8e19845fec578972cf85a02ab8
push id35713
push usercbrindusan@mozilla.com
push dateFri, 15 Mar 2019 21:55:43 +0000
treeherdermozilla-central@66b1aba3fb43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1529726, 15414
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 1529726 [wpt PR 15414] - HTML: window.length and named access, a=testonly Automatic update from web-platform-tests HTML: window.length and named access For https://github.com/whatwg/html/pull/4368. -- wpt-commits: 3a43f99a56a4c016e3f1cda41330f1a2c0e780ff wpt-pr: 15414
testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js
@@ -0,0 +1,24 @@
+async_test(t => {
+  const frame = document.createElement("iframe");
+  frame.srcdoc = "<iframe name=x srcdoc='<iframe name=z></iframe>'></iframe><iframe name=y></iframe>";
+  frame.onload = t.step_func_done(() => {
+    const frameW = frame.contentWindow;
+    assert_equals(frameW.length, 2);
+    assert_not_equals(frameW.x, undefined);
+    assert_not_equals(frameW.y, undefined);
+    assert_equals(frameW.z, undefined);
+    assert_equals(frameW.x, frameW[0]);
+    assert_equals(frameW.y, frameW[1]);
+    const xFrameW = frameW.x;
+    assert_equals(xFrameW.length, 1);
+    assert_not_equals(xFrameW.z, undefined);
+    assert_equals(xFrameW.z, xFrameW[0]);
+    frame.remove();
+    assert_equals(frameW.length, 0);
+    assert_equals(frameW.x, undefined);
+    assert_equals(frameW[0], undefined);
+    assert_equals(xFrameW.length, 0);
+    assert_equals(xFrameW.z, undefined);
+  });
+  document.body.append(frame);
+}, "Window object's length IDL attribute (and named access)");