blob: 77803f1c91be4152cf6bd2339b6ec72ac91f5f3f [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Media Queries - color-index, invalid numbers</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"/>
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#color-index"/>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
@media (color-index: 0.0) {}
@media (color-index: -1) {}
@media (color-index: 2.1) {}
</style>
<head>
<body>
<div id="log"></div>
<script>
test(function(){
assert_true(!!document.styleSheets[0]);
assert_true(!!document.styleSheets[0].cssRules);
assert_equals(document.styleSheets[0].cssRules.length, 3);
}, "CSSOM Sanity check");
var rules = document.styleSheets[0].cssRules;
test(function(){
assert_equals(rules[0].media.mediaText, "not all");
}, "(color-index: 0.0) is invalid");
test(function(){
assert_equals(rules[1].media.mediaText, "not all");
}, "(color-index: -1) is invalid");
test(function(){
assert_equals(rules[2].media.mediaText, "not all");
}, "(color-index: 2.1) is invalid");
</script>
</body>
</html>