Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / StyleSheet / removed-stylesheet-rule-deleted-parent-crash.html
1 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 {
6     testRunner.dumpAsText();
7     testRunner.waitUntilDone();
8 }
9
10 function runTest()
11 {
12     style = document.createElement('style');
13     style.textContent = 'body { color: red }';
14     document.head.appendChild(style);
15   
16     ruleList = getMatchedCSSRules(document.body);
17   
18     document.styleSheets[0].deleteRule(0);
19     document.head.removeChild(style);
20
21     gc();
22
23     if (!ruleList[0].parentStyleSheet)
24         document.getElementById('result').innerHTML = "PASS";
25     if (window.testRunner)
26         testRunner.notifyDone();
27 }
28
29 function gc()
30 {
31     if (window.GCController)
32         return GCController.collect();
33
34     for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
35         var s = new String("abc");
36     }
37 }
38 </script>
39 </head>
40 <body onload="runTest()">
41 <div id="result"></div>
42 </body>
43 </html>
44