content/base/test/test_bug690056.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug690056.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=690056
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 690056</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=690056">Mozilla Bug 690056</a>
    1.16 +<p id="display">
    1.17 +  <iframe id="x"></iframe>
    1.18 +  <iframe style="display: none" id="y"></iframe>
    1.19 +</p>
    1.20 +<div id="content" style="display: none">
    1.21 +  
    1.22 +</div>
    1.23 +<pre id="test">
    1.24 +<script type="application/javascript">
    1.25 +
    1.26 +/** Test for Bug 690056 **/
    1.27 +SimpleTest.waitForExplicitFinish();
    1.28 +is(document.hidden, false, "Document should not be hidden during load");
    1.29 +is(document.visibilityState, "visible",
    1.30 +   "Document should be visible during load");
    1.31 +
    1.32 +addLoadEvent(function() {
    1.33 +  var doc = document.implementation.createDocument("", "", null);
    1.34 +  is(doc.hidden, true, "Data documents should be hidden");
    1.35 +  is(doc.visibilityState, "hidden", "Data documents really should be hidden");
    1.36 +
    1.37 +  is(document.hidden, false, "Document should not be hidden onload");
    1.38 +  is(document.visibilityState, "visible",
    1.39 +     "Document should be visible onload");
    1.40 +
    1.41 +  is($("x").contentDocument.hidden, false,
    1.42 +     "Subframe document should not be hidden onload");
    1.43 +  is($("x").contentDocument.visibilityState, "visible",
    1.44 +     "Subframe document should be visible onload");
    1.45 +  is($("y").contentDocument.hidden, false,
    1.46 +     "display:none subframe document should not be hidden onload");
    1.47 +  is($("y").contentDocument.visibilityState, "visible",
    1.48 +     "display:none subframe document should be visible onload");
    1.49 +  
    1.50 +  SimpleTest.finish();
    1.51 +});
    1.52 +
    1.53 +
    1.54 +</script>
    1.55 +</pre>
    1.56 +</body>
    1.57 +</html>

mercurial