Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar

We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
This commit is contained in:
Emilio Cobos Álvarez
2023-06-23 10:01:32 +00:00
parent ad2058a73a
commit 529c9ee321
143 changed files with 622 additions and 775 deletions

View File

@@ -675,7 +675,7 @@ HTMLTextAreaElement::SubmitNamesValues(FormData* aFormData) {
// Get the name (if no name, no submit)
//
nsAutoString name;
GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
GetAttr(nsGkAtoms::name, name);
if (name.IsEmpty()) {
return NS_OK;
}
@@ -726,7 +726,7 @@ void HTMLTextAreaElement::SaveState() {
if (state) {
// We do not want to save the real disabled state but the disabled
// attribute.
state->disabled() = HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
state->disabled() = HasAttr(nsGkAtoms::disabled);
state->disabledSet() = true;
}
}
@@ -1025,7 +1025,7 @@ void HTMLTextAreaElement::UpdateValueMissingValidityState() {
void HTMLTextAreaElement::UpdateBarredFromConstraintValidation() {
SetBarredFromConstraintValidation(
HasAttr(kNameSpaceID_None, nsGkAtoms::readonly) ||
HasAttr(nsGkAtoms::readonly) ||
HasFlag(ELEMENT_IS_DATALIST_OR_HAS_DATALIST_ANCESTOR) || IsDisabled());
}