blob: 637f2c7a1e43793aef15a2acdbf9846235069be3 [file] [log] [blame]
<html>
<head id="head">
<script>
if (window.internals && window.internals.settings)
window.internals.settings.setDeferredCSSParserEnabled(true);
</script>
<style>
/* The support won't parse at all until we access cssRules below. */
@supports (madeup:madeup) {
/* 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>