Bug 1833570 - Correct the handling of popovertargetaction value. r=emilio
The popovertargetaction attribute's invalid value default and missing value default are both the toggle state. https://html.spec.whatwg.org/#popover-target-attribute-activation-behavior Differential Revision: https://phabricator.services.mozilla.com/D179050
This commit is contained in:
@@ -2881,12 +2881,13 @@ void nsGenericHTMLFormControlElementWithState::HandlePopoverTargetAction() {
|
||||
return;
|
||||
}
|
||||
|
||||
const nsAttrValue* value = GetParsedAttr(nsGkAtoms::popovertargetaction);
|
||||
if (!value) {
|
||||
return;
|
||||
auto action = PopoverTargetAction::Toggle;
|
||||
if (const nsAttrValue* value =
|
||||
GetParsedAttr(nsGkAtoms::popovertargetaction)) {
|
||||
MOZ_ASSERT(value->Type() == nsAttrValue::eEnum);
|
||||
action = static_cast<PopoverTargetAction>(value->GetEnumValue());
|
||||
}
|
||||
|
||||
auto action = static_cast<PopoverTargetAction>(value->GetEnumValue());
|
||||
bool canHide = action == PopoverTargetAction::Hide ||
|
||||
action == PopoverTargetAction::Toggle;
|
||||
bool canShow = action == PopoverTargetAction::Show ||
|
||||
|
||||
Reference in New Issue
Block a user