Bug 1372369 - Part 2: Set validity state to 'bad input' when the entered date value is invalid. r=smaug
If all fields in date/time input box are available but the input element's value is empty, implies that it has been sanitized. In this case, we'll set the 'bad input' validity state. If any of the fields is cleared, we'll remove the 'bad input' validity state, as incomplete field does not imply 'bad input'. MozReview-Commit-ID: 4EBpH5CWqXM
This commit is contained in:
@@ -125,6 +125,20 @@ nsDateTimeControlFrame::HandleBlurEvent()
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsDateTimeControlFrame::HasBadInput()
|
||||
{
|
||||
nsCOMPtr<nsIDateTimeInputArea> inputAreaContent =
|
||||
do_QueryInterface(mInputAreaContent);
|
||||
|
||||
bool result = false;
|
||||
if (inputAreaContent) {
|
||||
inputAreaContent->HasBadInput(&result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsDateTimeControlFrame::GetMinISize(gfxContext* aRenderingContext)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user