Bug 1374967 - Part 2: Consider step when deciding whether to show second/millisecond field. r=smaug

We should consider step and step base when deciding whether to show second and
millisecond field, since step and step base can affect the valid time intervals,
and the valid intervals may have second/millisecond part.

MozReview-Commit-ID: H4mJvLTvBOM
This commit is contained in:
Jessica Jong
2017-06-29 11:47:00 -04:00
parent 3aedcc0d5d
commit d14eef00ce
11 changed files with 288 additions and 38 deletions

View File

@@ -55,7 +55,7 @@ nsDateTimeControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
}
void
nsDateTimeControlFrame::UpdateInputBoxValue()
nsDateTimeControlFrame::OnValueChanged()
{
nsCOMPtr<nsIDateTimeInputArea> inputAreaContent =
do_QueryInterface(mInputAreaContent);
@@ -64,6 +64,16 @@ nsDateTimeControlFrame::UpdateInputBoxValue()
}
}
void
nsDateTimeControlFrame::OnMinMaxStepAttrChanged()
{
nsCOMPtr<nsIDateTimeInputArea> inputAreaContent =
do_QueryInterface(mInputAreaContent);
if (inputAreaContent) {
inputAreaContent->NotifyMinMaxStepAttrChanged();
}
}
void
nsDateTimeControlFrame::SetValueFromPicker(const DateTimeValue& aValue)
{