Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / StyleSheet / gc-declaration-parent-rule.html
blob697880a466a0eca4547e6f5e5603261d023cd075
1 <html>
2 <head>
3 <style>
4 div { color:black }
5 </style>
6 <script src="../../../resources/js-test.js"></script>
7 </head>
8 <body onload="test()">
9 <script>
10 window.jsTestIsAsync = true;
11 description("Test that CSS rules don't lose custom properties on GC when only reachable through its declarations.");
13 function test()
15 var sheet = document.styleSheets[0];
16 style = sheet.cssRules[0].style;
17 style.parentRule.foo = "bar";
18 document.getElementsByTagName("head")[0].removeChild(document.getElementsByTagName("style")[0]);
19 sheet = null;
21 gc();
22 setTimeout(function() {
23 gc();
24 shouldBe('style.parentRule.foo', '"bar"');
25 finishJSTest();
26 }, 0);
28 </script>
29 <foo id="mystyle" style="display:none">.div { color: white; }</foo>
30 </body>
31 </html>