518e15a6812cebd0eb724b0ee6018b94a6bdd53e
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / StyleSheet / gc-parent-stylesheet.html
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 </head>
5 <body onload="test()">
6 <script>
7 window.jsTestIsAsync = true;
8 description("Test that CSS stylesheets don't lose custom properties on GC when only reachable through child rules.");
9
10 function test()
11 {
12     var sheet = document.implementation.createCSSStyleSheet("title", "screen");
13     sheet.foo = "0";
14     sheet.insertRule("div { color:black }", 0);
15     rule = sheet.rules[0];
16     sheet = null;
17
18     gc();
19     setTimeout(function() {
20         gc();
21         shouldBe('rule.parentStyleSheet.foo', '"0"');
22         finishJSTest();
23     }, 0);
24 }
25 </script>
26 <foo id="mystyle" style="display:none">.div { color: white; }</foo>
27 </body>
28 </html>