layout/style/test/test_any_dynamic.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

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

mercurial