blob: b974252555aebad45c2be1855b5dfdedc0d38618 [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</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,innerbodyblur,";
17 }
18 assert_false(endedWith, "Should have gotten innerbodyfocus,innerbodyblur after willspineventloop");
19 }, "Check trailing events");
20 test(function() {
21 assert_equals(actual, "outeronload,activeElement:BODY,willfocusiframe,didfocusiframe,activeElement:IFRAME,willbluriframe,didbluriframe,activeElement:BODY,willspineventloop,innerbodyfocus,innerbodyblur,", 'Check log');
22 }, "Check result");
23 w.close();
24 done();
25};
26var w = window.open("support/activeelement-after-focusing-different-site-iframe-outer.sub.html");
27</script>