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 522480 8566ae4d152605453ebe6715ec4f2f8af60a95d3
parent 522479 d60d45526348b7711d4bfcbbf75bcaea934bec4b
child 522481 fc797e4666ff65b5d09e8a1525e00ce8789469a7
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [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)");