content/base/test/test_bug894874.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug894874.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=894874
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 894874</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <!-- IMPORTANT: Keep the sheets in this order! -->
    1.14 +  <link rel="stylesheet" type="text/css" href="data:text/css,">
    1.15 +  <link rel="stylesheet" type="text/css" title="one" href="data:text/css,">
    1.16 +  <link rel="stylesheet" type="text/css" title="two" href="data:text/css,">
    1.17 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.18 +  <script type="application/javascript">
    1.19 +
    1.20 +  /** Test for Bug 894874 **/
    1.21 +  SimpleTest.waitForExplicitFinish();
    1.22 +  addLoadEvent(function() {
    1.23 +    is(document.styleSheets[0].disabled, false,
    1.24 +       "Sheet with no title should be enabled");
    1.25 +    is(document.styleSheets[1].disabled, false,
    1.26 +       "First preferred sheet should be enabled");
    1.27 +    is(document.styleSheets[2].disabled, true,
    1.28 +       "Second preferred sheet should be disabled");
    1.29 +    is(document.selectedStyleSheetSet, "one", "Sheet one is enabled");
    1.30 +    document.styleSheets[0].disabled = true;
    1.31 +    document.styleSheets[2].disabled = false;
    1.32 +    ok(document.selectedStyleSheetSet === null,
    1.33 +       "Sheet one and sheet two are both enabled");
    1.34 +    SimpleTest.finish();
    1.35 +  });
    1.36 +
    1.37 +  </script>
    1.38 +</head>
    1.39 +<body>
    1.40 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=894874">Mozilla Bug 894874</a>
    1.41 +<p id="display"></p>
    1.42 +<div id="content" style="display: none">
    1.43 +
    1.44 +</div>
    1.45 +<pre id="test">
    1.46 +</pre>
    1.47 +</body>
    1.48 +</html>

mercurial