Bug 1760709 - Remove some useless namespacing in HTMLInputElement. r=smaug

Drive-by cleanups.

Differential Revision: https://phabricator.services.mozilla.com/D141705
This commit is contained in:
Emilio Cobos Álvarez 2022-03-22 11:10:53 +00:00
Родитель 18d44b2570
Коммит 0b00fcf9fd
2 изменённых файлов: 16 добавлений и 19 удалений

Просмотреть файл

@ -851,8 +851,7 @@ void HTMLInputElement::InitUploadLastDir() {
gUploadLastDir = new UploadLastDir();
NS_ADDREF(gUploadLastDir);
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
nsCOMPtr<nsIObserverService> observerService = services::GetObserverService();
if (observerService && gUploadLastDir) {
observerService->AddObserver(gUploadLastDir,
"browser:purge-session-history", true);
@ -949,9 +948,8 @@ static nsresult FireEventForAccessibility(HTMLInputElement* aTarget,
// construction, destruction
//
HTMLInputElement::HTMLInputElement(
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser, FromClone aFromClone)
HTMLInputElement::HTMLInputElement(already_AddRefed<dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser, FromClone aFromClone)
: TextControlElement(std::move(aNodeInfo), aFromParser,
FormControlType(kInputDefaultType->value)),
mAutocompleteAttrState(nsContentUtils::eAutocompleteAttrState_Unknown),
@ -2935,7 +2933,7 @@ void HTMLInputElement::MaybeSubmitForm(nsPresContext* aPresContext) {
} else if (!mForm->ImplicitSubmissionIsDisabled()) {
// If there's only one text control, just submit the form
// Hold strong ref across the event
RefPtr<mozilla::dom::HTMLFormElement> form(mForm);
RefPtr<dom::HTMLFormElement> form(mForm);
form->MaybeSubmit(nullptr);
}
}
@ -4054,7 +4052,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
case FormControlType::InputImage:
if (mForm) {
// Hold a strong ref while dispatching
RefPtr<mozilla::dom::HTMLFormElement> form(mForm);
RefPtr<HTMLFormElement> form(mForm);
if (mType == FormControlType::InputReset) {
form->MaybeReset(this);
} else {
@ -5323,8 +5321,7 @@ already_AddRefed<Promise> HTMLInputElement::GetFilesAndDirectories(
Sequence<OwningFileOrDirectory> filesAndDirsSeq;
if (!filesAndDirsSeq.SetLength(filesAndDirs.Length(),
mozilla::fallible_t())) {
if (!filesAndDirsSeq.SetLength(filesAndDirs.Length(), fallible)) {
p->MaybeReject(NS_ERROR_OUT_OF_MEMORY);
return p.forget();
}
@ -6741,7 +6738,7 @@ void HTMLInputElement::SetFilePickerFiltersFromAccept(
// Services to retrieve image/*, audio/*, video/* filters
nsCOMPtr<nsIStringBundleService> stringService =
mozilla::components::StringBundle::Service();
components::StringBundle::Service();
if (!stringService) {
return;
}

Просмотреть файл

@ -302,7 +302,7 @@ class HTMLInputElement final : public TextControlElement,
bool IsTooShort();
bool IsValueMissing() const;
bool HasTypeMismatch() const;
mozilla::Maybe<bool> HasPatternMismatch() const;
Maybe<bool> HasPatternMismatch() const;
bool IsRangeOverflow() const;
bool IsRangeUnderflow() const;
bool HasStepMismatch(bool aUseZeroIfValueNaN = false) const;
@ -1067,7 +1067,7 @@ class HTMLInputElement final : public TextControlElement,
MOZ_CAN_RUN_SCRIPT void FreeData();
TextControlState* GetEditorState() const;
MOZ_CAN_RUN_SCRIPT mozilla::TextEditor* GetTextEditorFromState();
MOZ_CAN_RUN_SCRIPT TextEditor* GetTextEditorFromState();
/**
* Manages the internal data storage across type changes.
@ -1476,13 +1476,13 @@ class HTMLInputElement final : public TextControlElement,
UniquePtr<InputType, InputType::DoNotDelete> mInputType;
static constexpr size_t INPUT_TYPE_SIZE =
sizeof(mozilla::Variant<
TextInputType, SearchInputType, TelInputType, URLInputType,
EmailInputType, PasswordInputType, NumberInputType, RangeInputType,
RadioInputType, CheckboxInputType, ButtonInputType, ImageInputType,
ResetInputType, SubmitInputType, DateInputType, TimeInputType,
WeekInputType, MonthInputType, DateTimeLocalInputType,
FileInputType, ColorInputType, HiddenInputType>);
sizeof(Variant<TextInputType, SearchInputType, TelInputType, URLInputType,
EmailInputType, PasswordInputType, NumberInputType,
RangeInputType, RadioInputType, CheckboxInputType,
ButtonInputType, ImageInputType, ResetInputType,
SubmitInputType, DateInputType, TimeInputType,
WeekInputType, MonthInputType, DateTimeLocalInputType,
FileInputType, ColorInputType, HiddenInputType>);
// Memory allocated for mInputType, reused when type changes.
char mInputTypeMem[INPUT_TYPE_SIZE];