<!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>
