blob: f0eb18bc75a989671b532922f03f800bb86e6ada [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('Check if the pattern constraint is not applied to some input types.');
var input = document.createElement('input');
input.type = 'range';
input.pattern = '[0-9]'; // Restrict to single digit
input.value = '11';
// pattern doesn't work for type=range
shouldBe('input.validity.patternMismatch', 'false');
// works for type=text.
input.type = 'text';
shouldBe('input.validity.patternMismatch', 'true');
</script>
</body>
</html>