blob: ad76c15e11d6f7c7572175da00e056960ae39f06 [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 pointer media feature.")
var testCases = [
"pointer:",
"pointer: ",
"pointer: WebKit",
"pointer: pointer",
"pointer: hover",
"pointer: portrait",
"pointer: \\\"None\\\"",
"pointer: '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>