Skip to content

Commit

Permalink
HTML: window.length and named access
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk authored and Marcos Cáceres committed Jul 23, 2019
1 parent a34280d commit 222c011
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions html/browsers/the-window-object/length-attribute.window.js
Original file line number Diff line number Diff line change
@@ -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)");

0 comments on commit 222c011

Please sign in to comment.