Bug 1856156 - Recompute auto directionality on input type changes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D198588
This commit is contained in:
@@ -1112,7 +1112,7 @@ class HTMLInputElement final : public TextControlElement,
|
||||
* Sets the direction from the input value. if aKnownValue is provided, it
|
||||
* saves a GetValue call.
|
||||
*/
|
||||
void SetDirectionFromValue(bool aNotify,
|
||||
void SetAutoDirectionality(bool aNotify,
|
||||
const nsAString* aKnownValue = nullptr);
|
||||
|
||||
/**
|
||||
@@ -1600,8 +1600,8 @@ class HTMLInputElement final : public TextControlElement,
|
||||
/**
|
||||
* https://html.spec.whatwg.org/#auto-directionality-form-associated-elements
|
||||
*/
|
||||
bool IsAutoDirectionalityAssociated() const {
|
||||
switch (mType) {
|
||||
static bool IsAutoDirectionalityAssociated(FormControlType aType) {
|
||||
switch (aType) {
|
||||
case FormControlType::InputHidden:
|
||||
case FormControlType::InputText:
|
||||
case FormControlType::InputSearch:
|
||||
@@ -1618,6 +1618,10 @@ class HTMLInputElement final : public TextControlElement,
|
||||
}
|
||||
}
|
||||
|
||||
bool IsAutoDirectionalityAssociated() const {
|
||||
return IsAutoDirectionalityAssociated(mType);
|
||||
}
|
||||
|
||||
static bool CreatesDateTimeWidget(FormControlType aType) {
|
||||
return aType == FormControlType::InputDate ||
|
||||
aType == FormControlType::InputTime ||
|
||||
|
||||
Reference in New Issue
Block a user