Bug 1028712 - Add tests to check that when <input type=number> is stepped it isn't put into range overflow/underflow, even when its value is empty and min/max is above/below zero respectively. r=jwatt

This commit is contained in:
Giovanni Sferro 2014-11-26 09:54:35 +00:00
parent 7ba086a59b
commit 9b1168e5e8

View File

@ -170,6 +170,12 @@ function checkStepDown()
[ '10', '2', '0', '4', '5', '0', false ],
// value = "" (NaN).
[ '', null, null, null, null, '-1', false ],
[ '', '2', null, null, null, '-2', false ],
[ '', '2', '3', null, null, '3', false ],
[ '', null, '3', null, null, '3', false ],
[ '', '2', '3', '8', null, '3', false ],
[ '', null, '-10', '10', null, '-1', false ],
[ '', '3', '-10', '10', null, '-1', false ],
// With step = 'any'.
[ '0', 'any', null, null, 1, null, true ],
[ '0', 'ANY', null, null, 1, null, true ],
@ -485,6 +491,13 @@ function checkStepUp()
[ '-3', '2', '-6', '-1', null, '-2', false ],
// value = "" (NaN).
[ '', null, null, null, null, '1', false ],
[ '', null, null, null, null, '1', false ],
[ '', '2', null, null, null, '2', false ],
[ '', '2', '3', null, null, '3', false ],
[ '', null, '3', null, null, '3', false ],
[ '', '2', '3', '8', null, '3', false ],
[ '', null, '-10', '10', null, '1', false ],
[ '', '3', '-10', '10', null, '2', false ],
// With step = 'any'.
[ '0', 'any', null, null, 1, null, true ],
[ '0', 'ANY', null, null, 1, null, true ],