blob: 0523c50f095a89d0ad264fecd76cc0d23ea6e835 [file] [log] [blame]
<html>
<head>
<script>
if (window.layoutTestController)
{
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
function runTest()
{
style = document.createElement('style');
style.textContent = 'body { color: red }';
document.head.appendChild(style);
ruleList = getMatchedCSSRules(document.body);
document.styleSheets[0].deleteRule(0);
document.head.removeChild(style);
gc();
if (!ruleList[0].parentStyleSheet)
document.getElementById('result').innerHTML = "PASS";
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function gc()
{
if (window.GCController)
return GCController.collect();
for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
var s = new String("abc");
}
}
</script>
</head>
<body onload="runTest()">
<div id="result"></div>
</body>
</html>