7 console
.log("FAIL: The input element is focused.");
12 var activeTag
= document
.querySelector('iframe').contentDocument
.activeElement
.tagName
;
13 if (activeTag
== "INPUT")
14 console
.log("FAIL: The input element is focused.");
16 console
.log("PASS: The input element is not focused.");
17 if (window
.testRunner
)
18 testRunner
.notifyDone();
23 if (window
.testRunner
) {
24 testRunner
.dumpAsText();
25 testRunner
.waitUntilDone();
27 var frameDocument
= document
.querySelector('iframe').contentDocument
;
28 var autofocusInput
= frameDocument
.createElement('input');
29 autofocusInput
.autofocus
= true;
30 autofocusInput
.onfocus
= fail
;
31 frameDocument
.body
.appendChild(autofocusInput
);
32 frameDocument
.body
.offsetTop
;
33 window
.setTimeout(finishTest
, 0);
37 <body onload=
"runTest()">
38 <p>This test passes if the input element in the sandboxed frame is not
39 automatically focused upon, as it should be blocked by the sandboxed
40 scripts flag. A console warning to that effect should also be present.
</p>
41 <iframe sandbox=
"allow-same-origin"></iframe>