activeelement-after-focusing-different-site-iframe-contentwindow.html (1592B)
1 <!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> 7 setup({explicit_done:true}); 8 window.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 }; 35 var w = window.open("support/activeelement-after-focusing-different-site-iframe-outer-contentwindow.sub.html"); 36 </script>