OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../js/resources/js-test-pre.js"></script> | 3 <script src="../../../resources/js-test.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 stylesheets don't lose custom properties on GC when o
nly reachable through child rules."); | 8 description("Test that CSS stylesheets don't lose custom properties on GC when o
nly reachable 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.foo = "0"; | 13 sheet.foo = "0"; |
14 sheet.insertRule("div { color:black }", 0); | 14 sheet.insertRule("div { color:black }", 0); |
15 rule = sheet.rules[0]; | 15 rule = sheet.rules[0]; |
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.parentStyleSheet.foo', '"0"'); | 21 shouldBe('rule.parentStyleSheet.foo', '"0"'); |
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 </body> | 27 </body> |
28 </html> | 28 </html> |
OLD | NEW |