Skip to content

Questions/issues with popover spec #9036

Closed
@jakearchibald

Description

@jakearchibald

I'm reading the popover spec for the first time. Here are some notes & questions. If any of these turn out to be things that should be changed, I'll split each out into their own issue.

https://html.spec.whatwg.org/multipage/popover.html#auto-popover-list

The Document has an auto popover list, which is a list of all the elements in the Document's top layer whose popover attribute is in the auto state, in the same order.

"in the same order" seems confusing here. Does it mean document order? Is this list intended to be live? I'd rather turn this into an algorithm that returns a static list, and makes the ordering clear.

Is "in the Document's top layer" problematic here? If an element is a descendant of an element in the top layer, is it considered "in the top layer"? I'm worried that "in the top layer" is being used to mean "the popover is shown" here, but that might not be clear/true.

https://html.spec.whatwg.org/multipage/popover.html#the-popover-attribute:concept-element-attributes-change-ext

The following attribute change steps are used for all HTML elements:

Nit: This algorithm references arguments that aren't specified up front. I'd like to fix this.

If oldValue and value are in different states, then run the hide popover algorithm given element, true, true, and false.

This seems a bit of a hand-wave, and 'states' doesn't seem to link to the right thing. I'd like to fix this.

https://html.spec.whatwg.org/multipage/popover.html#check-popover-validity

It seems weird to me that showPopover() and hidePopover() throw if the element is already in that state. I think we usually avoid throwing in these cases. <dialog> throws if showModal() is called when it's already in that state, but that seems to be an outlier. <dialog>'s close() doesn't throw if the state is already closed.

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