4 <script src=
"../../../resources/js-test.js"></script>
8 description('Test for validationMessage IDL attribute for <input type=range>');
9 var parent
= document
.createElement('div');
10 document
.body
.appendChild(parent
);
11 parent
.innerHTML
= '<input type=range id=range maxlength=1 pattern=x>';
12 var input
= document
.getElementById('range');
14 function testIt(value
, min
, max
, step
)
16 input
.setAttribute("max", max
);
17 input
.setAttribute("min", min
);
18 input
.setAttribute("step", step
);
19 input
.setAttribute("value", value
);
20 return input
.validationMessage
;
24 shouldBeEqualToString('testIt("", "", "")', '');
26 debug('Value missing')
27 input
.setAttribute("required", "");
28 shouldBeEqualToString('testIt("", "", "")', '');
29 input
.removeAttribute("required");
31 debug('Type mismatch');
32 shouldBeEqualToString('testIt("foo", "", "")', '');
34 debug('Range overflow')
35 shouldBeEqualToString('testIt("200", "", "100")', '');
37 debug('Range underflow')
38 shouldBeEqualToString('testIt("10", "50", "100")', '');
40 debug('Step mismatch')
41 shouldBeEqualToString('testIt("55", "0", "100", "10")', '');