|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=478160 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 478160</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 id="style" type="text/css"></style> |
|
11 </head> |
|
12 <body> |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478160">Mozilla Bug 478160</a> |
|
14 <p id="display"></p> |
|
15 <div id="content" style="display: none"> |
|
16 |
|
17 </div> |
|
18 <pre id="test"> |
|
19 <script type="application/javascript"> |
|
20 |
|
21 /** Test for Bug 478160 **/ |
|
22 |
|
23 var style_element = document.getElementById("style"); |
|
24 var style_text = document.createTextNode(""); |
|
25 style_element.appendChild(style_text); |
|
26 |
|
27 function test_at_rule(str) { |
|
28 style_text.data = str; |
|
29 is(style_element.sheet.cssRules.length, 1, |
|
30 "should have one rule from " + str); |
|
31 var ser1 = style_element.sheet.cssRules[0].cssText; |
|
32 isnot(ser1, "", "should have non-empty rule from " + str); |
|
33 style_text.data = ser1; |
|
34 var ser2 = style_element.sheet.cssRules[0].cssText; |
|
35 is(ser2, ser1, "parse+serialize should be idempotent for " + str); |
|
36 } |
|
37 |
|
38 test_at_rule("@namespace 'a b'"); |
|
39 |
|
40 </script> |
|
41 </pre> |
|
42 </body> |
|
43 </html> |