Skip to content

Commit

Permalink
HTML: window.focus() sans browsing context
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Feb 22, 2019
1 parent a4d3950 commit 84a4495
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions html/browsers/the-window-object/focus.window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
async_test(t => {
const input = document.body.appendChild(document.createElement("input"));
input.onfocus = t.step_func(() => {
const frame = document.body.appendChild(document.createElement("iframe")),
frameW = frame.contentWindow;
frameW.onfocus = t.unreached_func();
frame.remove();
frameW.focus();
t.step_timeout(() => {
assert_equals(document.activeElement, input);
t.done();
}, 100);
});
input.focus();
});

0 comments on commit 84a4495

Please sign in to comment.