Skip to content

When the popover attribute is removed, the hide popover algorithm will return too early #9367

@ghost

Description

Given whatwg/dom#1176, the popover attribute is removed before running the element's attribute change steps.
Those steps are defined for the popover attribute: https://html.spec.whatwg.org/#attr-popover which in step 3 invoke the hide popover algorithm (https://html.spec.whatwg.org/#hide-popover-algorithm). That invokes checking the popover validity (https://html.spec.whatwg.org/#check-popover-validity) as its first step and if it returns false, returns early. The latter function checks in its first step, whether the element's popover attribute is in the "no popover state". Hence,

somePopoverElement.showPopover();
setTimeout(() => {
    somePopoverElement.removeAttribute("popover");
}, 1000);

will return early from the hide popover algorithm. Hence, the popover will remain open.

Seems related to #9161 and whatwg/dom#1185 (comment)

CC @josepharhar @jakearchibald @rwlbuis

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: popoverThe popover attribute and friends

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions