test_any_dynamic.html (1371B)
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 src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 <style type="text/css"> 11 12 :-moz-any(#display, #display2) { text-decoration-line: underline } 13 p:-moz-any([foo], [bar]) { z-index: 17 } 14 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"> 22 23 /** 24 * Test for Bug 544834 25 * 26 * In particular, test that we go through :-moz-any() in AddRule. 27 */ 28 29 function run() 30 { 31 var p = document.getElementById("display"); 32 var cs = getComputedStyle(p, ""); 33 is(cs.textDecorationLine, "underline", "should match first rule"); 34 is(cs.zIndex, "auto", "should not match second rule"); 35 p.removeAttribute("id"); 36 is(cs.textDecorationLine, "none", "should not match first rule"); 37 is(cs.zIndex, "auto", "should not match second rule"); 38 p.setAttribute("foo", "v"); 39 is(cs.textDecorationLine, "none", "should not match first rule"); 40 is(cs.zIndex, "17", "should match second rule"); 41 SimpleTest.finish(); 42 } 43 44 SimpleTest.waitForExplicitFinish(); 45 46 </script> 47 </pre> 48 </body> 49 </html>