blob: f702cf9f5dbd82354a8d70bfdfc81d1e0defa6ef [file] [log] [blame]
<html>
<head id="head">
<script>
if (window.internals && window.internals.settings)
window.internals.settings.setDeferredCSSParserEnabled(true);
</script>
<style>
/* The media block won't parse at all until we access cssRules below. */
@media print {
/* This rule should not parse, since it's inside print media. */
body {
color: black;
}
/* This rule should parse because it is empty. */
.unknown {
}
/* This rule should not parse. */
div#unknown {
color:red;
}
/* This rule should not parse. */
faketag {
color:lime;
background-color:blue;
border:10px solid white;
}
}
</style>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body >
<script>
document.body.offsetWidth;
description("This tests deferred parsing of CSS style rules.");
debug('');
if (window.internals) {
shouldBe("internals.deferredStyleRulesCount(document.styleSheets[0])", "0");
shouldBe("internals.deferredGroupRulesCount(document.styleSheets[0])", "1");
}
var mediaRules = document.styleSheets[0].cssRules[0].cssRules
if (window.internals) {
shouldBe("internals.deferredGroupRulesCount(document.styleSheets[0])", "0");
shouldBe("internals.deferredStyleRulesCount(document.styleSheets[0])", "3");
}
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>