Bug 1839315: part 6) Lift code for fetchpriority attribute from nsGenericHTMLElementWithFetchPriorityAttribute to nsGenericHTMLElement. r=smaug

As requested in the review of part 1.

Differential Revision: https://phabricator.services.mozilla.com/D191274
This commit is contained in:
Mirko Brodesser
2023-10-23 08:14:51 +00:00
parent 5aea9e3cf1
commit c9f82f9c46
10 changed files with 75 additions and 140 deletions

View File

@@ -49,7 +49,7 @@ namespace mozilla::dom {
HTMLLinkElement::HTMLLinkElement(
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElementWithFetchPriorityAttribute(std::move(aNodeInfo)) {}
: nsGenericHTMLElement(std::move(aNodeInfo)) {}
HTMLLinkElement::~HTMLLinkElement() { SupportsDNSPrefetch::Destroyed(*this); }
@@ -163,10 +163,15 @@ bool HTMLLinkElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
aResult.ParseStringOrAtom(aValue);
return true;
}
if (aAttribute == nsGkAtoms::fetchpriority) {
ParseFetchPriority(aValue, aResult);
return true;
}
}
return nsGenericHTMLElementWithFetchPriorityAttribute::ParseAttribute(
aNamespaceID, aAttribute, aValue, aMaybeScriptedPrincipal, aResult);
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
void HTMLLinkElement::CreateAndDispatchEvent(const nsAString& aEventName) {