blob: 1a128ec8a96addfd79f16434a825466d4a0ab692 [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('This test aims to check for rangeUnderflow flag with input fields');
var input = document.createElement('input');
function checkNotUnderflow(value, min, disabled)
{
input.value = value;
input.min = min;
input.disabled = !!disabled;
var underflow = input.validity.rangeUnderflow;
var resultText = 'The value "' + input.value + '" ' +
(underflow ? 'underflows' : 'doesn\'t underflow') +
' the minimum value "' + input.min + '"' + (disabled ? ' when disabled.' : '.');
if (underflow)
testFailed(resultText);
else
testPassed(resultText);
}
// ----------------------------------------------------------------
debug('Type=text');
input.type = 'text'; // No underflow for type=text.
checkNotUnderflow('99', '100');
</script>
</body>
</html>