Bug 1310080 - Implement the step attribute for <input type=datetime-local>. r=smaug

This commit is contained in:
Jessica Jong
2017-02-07 22:03:00 +08:00
parent 0ece9ea921
commit d4c3c8ce4d
8 changed files with 251 additions and 61 deletions

View File

@@ -2433,11 +2433,8 @@ HTMLInputElement::GetMaximum() const
Decimal
HTMLInputElement::GetStepBase() const
{
MOZ_ASSERT(mType == NS_FORM_INPUT_NUMBER ||
mType == NS_FORM_INPUT_DATE ||
mType == NS_FORM_INPUT_TIME ||
mType == NS_FORM_INPUT_MONTH ||
mType == NS_FORM_INPUT_WEEK ||
MOZ_ASSERT(IsDateTimeInputType(mType) ||
mType == NS_FORM_INPUT_NUMBER ||
mType == NS_FORM_INPUT_RANGE,
"Check that kDefaultStepBase is correct for this new type");
@@ -8671,6 +8668,7 @@ HTMLInputElement::GetStepScaleFactor() const
case NS_FORM_INPUT_RANGE:
return kStepScaleFactorNumberRange;
case NS_FORM_INPUT_TIME:
case NS_FORM_INPUT_DATETIME_LOCAL:
return kStepScaleFactorTime;
case NS_FORM_INPUT_MONTH:
return kStepScaleFactorMonth;
@@ -8695,6 +8693,7 @@ HTMLInputElement::GetDefaultStep() const
case NS_FORM_INPUT_RANGE:
return kDefaultStep;
case NS_FORM_INPUT_TIME:
case NS_FORM_INPUT_DATETIME_LOCAL:
return kDefaultStepTime;
default:
MOZ_ASSERT(false, "Unrecognized input type");