Bug 771561 - Make HTMLInputElement.stepUp()/stepDown() work when the input's value is NaN. r=smaug

This commit is contained in:
Jonathan Watt 2013-11-20 09:32:45 +00:00
Родитель fd43eb5704
Коммит f1da82e63e
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -2061,7 +2061,7 @@ HTMLInputElement::ApplyStep(int32_t aStep)
Decimal value = GetValueAsDecimal();
if (value.isNaN()) {
return NS_OK;
value = 0;
}
Decimal minimum = GetMinimum();

Просмотреть файл

@ -169,7 +169,7 @@ function checkStepDown()
[ '10', '2', '0', '4', '10', '0', false ],
[ '10', '2', '0', '4', '5', '0', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
[ '', null, null, null, null, '-1', false ],
// With step = 'any'.
[ '0', 'any', null, null, 1, null, true ],
[ '0', 'ANY', null, null, 1, null, true ],
@ -304,7 +304,7 @@ function checkStepDown()
[ '1970-03-08', '3', '1970-02-01', '1970-02-07', 15, '1970-02-01', false ],
[ '1970-01-10', '3', '1970-01-01', '1970-01-06', 2, '1970-01-04', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
[ '', null, null, null, null, '1969-12-31', false ],
// With step = 'any'.
[ '2012-01-01', 'any', null, null, 1, null, true ],
[ '2012-01-01', 'ANY', null, null, 1, null, true ],
@ -368,7 +368,7 @@ function checkStepDown()
[ '17:22', '180', '17:00', '17:20', 15, '17:00', false ],
[ '17:22', '180', '17:10', '17:20', 2, '17:16', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
[ '', null, null, null, null, '23:59', false ],
// With step = 'any'.
[ '17:26', 'any', null, null, 1, null, true ],
[ '17:26', 'ANY', null, null, 1, null, true ],
@ -484,7 +484,7 @@ function checkStepUp()
[ '-3', '2', '-6', '-2', null, '-2', false ],
[ '-3', '2', '-6', '-1', null, '-2', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
[ '', null, null, null, null, '1', false ],
// With step = 'any'.
[ '0', 'any', null, null, 1, null, true ],
[ '0', 'ANY', null, null, 1, null, true ],
@ -619,7 +619,7 @@ function checkStepUp()
[ '1970-01-01', '3', '1970-02-01', '1970-02-07', 15, '1970-02-07', false ],
[ '1970-01-01', '3', '1970-01-01', '1970-01-06', 2, '1970-01-04', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
[ '', null, null, null, null, '1970-01-02', false ],
// With step = 'any'.
[ '2012-01-01', 'any', null, null, 1, null, true ],
[ '2012-01-01', 'ANY', null, null, 1, null, true ],
@ -683,7 +683,7 @@ function checkStepUp()
[ '17:22', '180', '17:00', '17:20', 15, '17:22', false ],
[ '17:22', '180', '17:10', '17:20', 2, '17:22', false ],
// value = "" (NaN).
[ '', null, null, null, null, '', false ],
[ '', null, null, null, null, '00:01', false ],
// With step = 'any'.
[ '17:26', 'any', null, null, 1, null, true ],
[ '17:26', 'ANY', null, null, 1, null, true ],