Bug 1879001 - Remove the popovertarget attribute or set it to an invalid value should clear the explicitly set attr-element. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D201711
This commit is contained in:
Ziran Sun
2024-02-16 21:51:24 +00:00
parent 3a411e96d5
commit 021e5f2541
5 changed files with 46 additions and 9 deletions

View File

@@ -762,6 +762,8 @@ void nsGenericHTMLElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
nsContentUtils::AddScriptRunner(
NewRunnableMethod("nsGenericHTMLElement::AfterSetPopoverAttr", this,
&nsGenericHTMLElement::AfterSetPopoverAttr));
} else if (aName == nsGkAtoms::popovertarget) {
ClearExplicitlySetAttrElement(nsGkAtoms::popovertarget);
} else if (aName == nsGkAtoms::dir) {
auto dir = Directionality::Ltr;
// A boolean tracking whether we need to recompute our directionality.