blob: 65094c917f77cc4b72f8bad1ad69b1ee2e45611d [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 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>
</body>
</html>