layout/style/test/test_any_dynamic.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=544834
     5 -->
     6 <head>
     7   <title>Test for Bug 544834</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10   <style type="text/css">
    12   :-moz-any(#display, #display2) { text-decoration: underline }
    13   p:-moz-any([foo], [bar]) { z-index: 17 }
    15   </style>
    16 </head>
    17 <body onload="run()">
    18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=544834">Mozilla Bug 544834</a>
    19 <p id="display" style="position:absolute"></p>
    20 <pre id="test">
    21 <script type="application/javascript">
    23 /**
    24  * Test for Bug 544834
    25  *
    26  * In particular, test that we go through :-moz-any() in AddRule.
    27  */
    29 function run()
    30 {
    31   var p = document.getElementById("display");
    32   var cs = getComputedStyle(p, "");
    33   is(cs.textDecoration, "underline", "should match first rule");
    34   is(cs.zIndex, "auto", "should not match second rule");
    35   p.removeAttribute("id");
    36   is(cs.textDecoration, "none", "should not match first rule");
    37   is(cs.zIndex, "auto", "should not match second rule");
    38   p.setAttribute("foo", "v");
    39   is(cs.textDecoration, "none", "should not match first rule");
    40   is(cs.zIndex, "17", "should match second rule");
    41   SimpleTest.finish();
    42 }
    44 SimpleTest.waitForExplicitFinish();
    46 </script>
    47 </pre>
    48 </body>
    49 </html>

mercurial