blob: b16280acbd7a85abb183d6c23c7508f6ce2fe17f [file] [log] [blame]
Henri Sivonen90ea6fe2020-09-14 13:08:591<!doctype html>
2<meta charset=utf-8>
3<title>activeElement when focusing different-site iframe's contentWindow</title>
4<script src=/resources/testharness.js></script>
5<script src=/resources/testharnessreport.js></script>
6<script>
7setup({explicit_done:true});
8window.onmessage = function(e) {
9 var actual = e.data;
10 test(function() {
11 // Handle trailing events separately to get make it easier to see
12 // if they are the only deviation from the expection.
13 var endedWith = false;
14 if (actual.endsWith(",willspineventloop,")) {
15 endedWith = true;
16 actual += "innerbodyfocus,";
17 }
18 assert_false(endedWith, "Should have gotten innerbodyfocus after willspineventloop");
19 }, "Check trailing events");
20 test(function() {
21 // This is a Fission oddity
22 var endedWith = false;
23 if (actual.endsWith(",willspineventloop,innerbodyfocus,")) {
24 endedWith = true;
25 actual += "innerbodyblur,innerbodyfocus,";
26 }
27 assert_true(endedWith, "Should have gotten innerbodyfocus after willspineventloop");
28 }, "Check more trailing events");
29 test(function() {
30 assert_equals(actual, "outeronload,activeElement:BODY,willfocusiframe,didfocusiframe,activeElement:IFRAME,willbluriframe,didbluriframe,activeElement:IFRAME,willspineventloop,innerbodyfocus,innerbodyblur,innerbodyfocus,", 'Check log');
31 }, "Check result");
32 w.close();
33 done();
34};
35var w = window.open("support/activeelement-after-focusing-different-site-iframe-outer-contentwindow.sub.html");
36</script>