Bug 1372369 - Part 1: Update input element's value when all fields are available and let DOM HTMLInputElement sanitize it. r=smaug
In this patch, we change it so that we always set the input element's value once all fields are available and let DOM HTMLInputElement sanitize it. The value after sanitization is not updated in the displayed input box, but may display an error message (this will be done in Part 2) if needed. Also, when any of the field's value is deleted, we will set input element's value back to the empty string, so that a value is not accidentally submitted. MozReview-Commit-ID: 9NAL8UlkoBK
This commit is contained in:
@@ -3089,7 +3089,8 @@ HTMLInputElement::SetValueInternal(const nsAString& aValue,
|
||||
}
|
||||
} else if ((mType == NS_FORM_INPUT_TIME ||
|
||||
mType == NS_FORM_INPUT_DATE) &&
|
||||
!IsExperimentalMobileType(mType)) {
|
||||
!IsExperimentalMobileType(mType) &&
|
||||
!(aFlags & nsTextEditorState::eSetValue_BySetUserInput)) {
|
||||
nsDateTimeControlFrame* frame = do_QueryFrame(GetPrimaryFrame());
|
||||
if (frame) {
|
||||
frame->UpdateInputBoxValue();
|
||||
|
||||
Reference in New Issue
Block a user