v132 · dom

Popover invoker and anchor positioning improvements

This chromestatus represents the following related set of changes, which were resolved in https://github.com/whatwg/html/pull/9144#issuecomment-2195095228 and landed in https://github.com/whatwg/html/pull/10728:

concepts

  1. Popover invoker anchor

    Popover invokers automatically become CSS anchors for their popover.

  2. menu per row

    Many invokers, no per-row anchor-name — the same popover template reused on every list row.

  3. invoker types

    Side-by-side popovertarget, commandfor+command, programmatic showPopover(), and command on a dialog. Snippets included.

  4. anchor chain (cascade menu)

    Submenu popover anchored to a menu item inside its parent popover. Compare declarative invokers, showPopover({ source }), and the missing-source failure case.

why it shipped

The popovertarget attribute creates an "invoker" relationship between the invoking button and the popover. That does several things:

references