blob: 59d1b7cfb7db44a6a1d21f052c927e8e3bf3f5b2 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('Tests for .valueAsNumber with non-supported input types.');
var input = document.createElement('input');
input.type = 'range';
document.body.appendChild(input);
function checkValueAsNumber(type) {
debug('Check for type=' + type);
input.value = '0';
input.type = type;
shouldBe('input.valueAsNumber', 'Number.NaN');
shouldThrowErrorName('input.valueAsNumber = 0', 'InvalidStateError');
}
checkValueAsNumber('button');
checkValueAsNumber('checkbox');
checkValueAsNumber('color');
checkValueAsNumber('email');
checkValueAsNumber('hidden');
checkValueAsNumber('image');
checkValueAsNumber('khtml_isindex');
checkValueAsNumber('password');
checkValueAsNumber('radio');
checkValueAsNumber('reset');
checkValueAsNumber('search');
checkValueAsNumber('submit');
checkValueAsNumber('tel');
checkValueAsNumber('text');
checkValueAsNumber('url');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>