OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../js/resources/js-test-pre.js"></script> | 3 <script src="../../js/resources/js-test-pre.js"></script> |
4 </head> | 4 </head> |
5 <body onload="test()"> | 5 <body onload="test()"> |
6 <script> | 6 <script> |
7 window.jsTestIsAsync = true; | 7 window.jsTestIsAsync = true; |
8 description("Test that CSS rules don't lose custom properties on GC when only re
achable through child rules."); | 8 description("Test that CSS rules don't lose custom properties on GC when only re
achable through child rules."); |
9 | 9 |
10 function test() | 10 function test() |
11 { | 11 { |
12 var sheet = document.implementation.createCSSStyleSheet("title", "screen"); | 12 var sheet = document.implementation.createCSSStyleSheet("title", "screen"); |
13 sheet.insertRule("@media all { div { color:black } }", 0); | 13 sheet.insertRule("@media all { div { color:black } }", 0); |
14 rule = sheet.rules[0].cssRules[0]; | 14 rule = sheet.rules[0].cssRules[0]; |
15 rule.parentRule.foo = "bar"; | 15 rule.parentRule.foo = "bar"; |
16 sheet = null; | 16 sheet = null; |
17 | 17 |
18 gc(); | 18 gc(); |
19 setTimeout(function() { | 19 setTimeout(function() { |
20 gc(); | 20 gc(); |
21 shouldBe('rule.parentRule.foo', '"bar"'); | 21 shouldBe('rule.parentRule.foo', '"bar"'); |
22 finishJSTest(); | 22 finishJSTest(); |
23 }, 0); | 23 }, 0); |
24 } | 24 } |
25 </script> | 25 </script> |
26 <foo id="mystyle" style="display:none">.div { color: white; }</foo> | 26 <foo id="mystyle" style="display:none">.div { color: white; }</foo> |
27 <script src="../../js/resources/js-test-post.js"></script> | |
28 </body> | 27 </body> |
29 </html> | 28 </html> |
OLD | NEW |