Bug 1660214 - Use CreatesDateTimeWidget() in two other places. r=smaug

I had missed these two. The NUMBER condition is dead (we early-return in
IsSingleLineTextControl above).

Differential Revision: https://phabricator.services.mozilla.com/D87721
This commit is contained in:
Emilio Cobos Álvarez
2020-08-20 12:53:18 +00:00
parent 2cc2a5896d
commit a201addcb7

View File

@@ -2655,8 +2655,7 @@ nsresult HTMLInputElement::SetValueInternal(const nsAString& aValue,
if (frame) {
frame->UpdateForValueChange();
}
} else if ((mType == NS_FORM_INPUT_TIME ||
mType == NS_FORM_INPUT_DATE) &&
} else if (CreatesDateTimeWidget() &&
!(aFlags & TextControlState::eSetValue_BySetUserInput)) {
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
@@ -6097,8 +6096,7 @@ bool HTMLInputElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
const bool defaultFocusable = true;
#endif
if (mType == NS_FORM_INPUT_NUMBER || mType == NS_FORM_INPUT_TIME ||
mType == NS_FORM_INPUT_DATE) {
if (CreatesDateTimeWidget()) {
if (aTabIndex) {
// We only want our native anonymous child to be tabable to, not ourself.
*aTabIndex = -1;