Bug 1681240 - Make TextControlState::SetValueFlags an enum class r=saschanaz
Using integer as a bit field may cause simple mistake and may not be easy to read, and we have `EnumSet` class which can treat an `enum class` as a bit flags so that we should make it an `enum class` and use it with the `EnumSet` class. Differential Revision: https://phabricator.services.mozilla.com/D99172
This commit is contained in:
@@ -117,6 +117,8 @@ class HTMLInputElement final : public TextControlElement,
|
||||
using nsGenericHTMLFormElementWithState::GetForm;
|
||||
using nsGenericHTMLFormElementWithState::GetFormAction;
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
using ValueSetterOption = TextControlState::ValueSetterOption;
|
||||
using ValueSetterOptions = TextControlState::ValueSetterOptions;
|
||||
|
||||
enum class FromClone { no, yes };
|
||||
|
||||
@@ -914,15 +916,14 @@ class HTMLInputElement final : public TextControlElement,
|
||||
* @param aValue String to set.
|
||||
* @param aOldValue Previous value before setting aValue.
|
||||
If previous value is unknown, aOldValue can be nullptr.
|
||||
* @param aFlags See TextControlState::SetValueFlags.
|
||||
* @param aOptions See TextControlState::ValueSetterOption.
|
||||
*/
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
nsresult SetValueInternal(const nsAString& aValue, const nsAString* aOldValue,
|
||||
uint32_t aFlags);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
nsresult SetValueInternal(const nsAString& aValue, uint32_t aFlags) {
|
||||
return SetValueInternal(aValue, nullptr, aFlags);
|
||||
MOZ_CAN_RUN_SCRIPT nsresult
|
||||
SetValueInternal(const nsAString& aValue, const nsAString* aOldValue,
|
||||
const ValueSetterOptions& aOptions);
|
||||
MOZ_CAN_RUN_SCRIPT nsresult SetValueInternal(
|
||||
const nsAString& aValue, const ValueSetterOptions& aOptions) {
|
||||
return SetValueInternal(aValue, nullptr, aOptions);
|
||||
}
|
||||
|
||||
// Generic getter for the value that doesn't do experimental control type
|
||||
|
||||
Reference in New Issue
Block a user