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 464583 8566ae4d1526
parent 464582 d60d45526348
child 464584 fc797e4666ff
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [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)");