blob: 32025fb83891df3ee5fcec48b0d94d31ce9233db [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<style id="target-style"></style>
<script>
description("Test invalid input with the any-hover media feature.")
var testCases = [
"any-hover:",
"any-hover: ",
"any-hover: WebKit",
"any-hover: fine",
"any-hover: portrait",
"any-hover: \\\"None\\\"",
"any-hover: 'None'",
];
var targetStyle = document.getElementById('target-style');
for (var testCase of testCases) {
var testString = 'window.matchMedia("(' + testCase + ')").matches';
shouldBeFalse('window.matchMedia("(' + testCase + ')").matches');
targetStyle.innerText = "@media " + testCase + " { }";
shouldBe("document.styleSheets[1].cssRules[0].media.length", "1");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>