test_default_view.html (1899B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>Page Visibility Null Default View Test</title> 6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 7 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script type="text/javascript" src="resources/pagevistestharness.js"></script> 11 12 <script type="text/javascript" > 13 setup({explicit_done: true}); 14 15 function onload_test() 16 { 17 // inject a windowless subdocument as a child of the root document <html> element 18 var subDoc = document.implementation.createDocument('resources/blank_page_green.html', 'html', null); 19 20 // Test precondition: ensure subdocument has a null default view 21 test_true(subDoc.defaultView == null, "windowless subdocument generated for test has a null default view"); 22 23 // check that feature exists within subdocument 24 test_feature_exists(subDoc, 'windowless subdocument'); 25 26 // check that the subdocument has a hidden visibility state 27 test_true(subDoc.hidden, 28 "hidden == true for windowless subdocuments with a null default view"); 29 test_equals(subDoc.visibilityState, VISIBILITY_STATES.HIDDEN, 30 "visibilityState == " + VISIBILITY_STATES.HIDDEN + 31 " for windowless subdocuments with a null default view"); 32 33 done(); 34 } 35 </script> 36 </head> 37 <body onload="onload_test()"> 38 <h1>Description</h1> 39 <p>This test validates that document.hidden == false and 40 document.visibilityState == "visible" for windowless subdocuments.</p> 41 <div id="log"></div> 42 </body> 43 </html>