blob: 716988ec0688f62c98a07efe5a62bcae52b22fda [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('This test aims to check for rangeOverflow flag with input fields');
var input = document.createElement('input');
function checkNotOverflow(value, max, disabled)
{
input.value = value;
input.max = max;
input.disabled = !!disabled;
var overflow = input.validity.rangeOverflow;
var resultText = 'The value "' + input.value + '" ' +
(overflow ? 'overflows' : 'doesn\'t overflow') +
' the maximum value "' + input.max + '"' + (disabled ? ' when disabled.' : '.');
if (overflow)
testFailed(resultText);
else
testPassed(resultText);
}
// ----------------------------------------------------------------
debug('Type=text');
input.type = 'text'; // No overflow for type=text.
checkNotOverflow('101', '100');
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>