Skip to content

Implement new/revised popover=hint behavior#59237

Open
chromium-wpt-export-bot wants to merge 1 commit intomasterfrom
chromium-export-cl-7727959
Open

Implement new/revised popover=hint behavior#59237
chromium-wpt-export-bot wants to merge 1 commit intomasterfrom
chromium-export-cl-7727959

Conversation

@chromium-wpt-export-bot
Copy link
Copy Markdown
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Apr 15, 2026

See this discussion for more context:

whatwg/html#12304
whatwg/html#12345

This CL implements a simplified behavioral model for popover=hint and
popover=auto, cleanly separating the autoRootedPopoverStack from the
hintRootedPopoverStack and introducing a hintStackParent to track
where the hint stack branches off the auto stack.

The new behavior resolves the following inconsistencies (gated behind
the PopoverHintNewBehavior experimental runtime flag):

  1. Opening a hint popover will not hide unrelated auto popovers.
  2. Opening a hint popover closes only other non-ancestor hint
    popovers.
  3. Clicking outside consistently closes both auto and hint popovers.
  4. Hiding an auto popover closes only its child popovers.
  5. Opening an auto popover inside a hint popover is disallowed and
    will fail.

A new WPT test (popover-hint-hierarchy.html) is added to explicitly
assert these 5 rules, and existing popover WPTs are updated to reflect
the new behavior. A virtual test suite (popover-hint-old-behavior)
is also added to continue testing the legacy behavior. I'm not sure
how to best handle the changed tests (and I guess the new test too)
in the context of a spec PR that is forthcoming. I'd like to be able
to publish (as a WPT PR at least) the changes, to help with the PR
effort. Suggestions appreciated.

A note about the diff: I made all of the feature flag checks look like
if (!feature enabled) { in the hopes that the old code would show
as unchanged in the diff, but gerrit's diff algorithm isn't great.
It's at least a little better like this than if I put the new code
first, so I left it.

Bug: 4990199
Change-Id: I41d8d96be71ba60ec5e7aa640c935258d1e33431
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7727959
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1615186}

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@chromium-wpt-export-bot chromium-wpt-export-bot marked this pull request as ready for review April 15, 2026 15:53
@chromium-wpt-export-bot chromium-wpt-export-bot requested a review from a team as a code owner April 15, 2026 15:53
See this discussion for more context:

whatwg/html#12304
whatwg/html#12345

This CL implements a simplified behavioral model for popover=hint and
popover=auto, cleanly separating the autoRootedPopoverStack from the
hintRootedPopoverStack and introducing a `hintStackParent` to track
where the hint stack branches off the auto stack.

The new behavior resolves the following inconsistencies (gated behind
the `PopoverHintNewBehavior` experimental runtime flag):

1. Opening a hint popover will not hide unrelated auto popovers.
2. Opening a hint popover closes only other non-ancestor hint
   popovers.
3. Clicking outside consistently closes both auto and hint popovers.
4. Hiding an auto popover closes only its child popovers.
5. Opening an auto popover inside a hint popover is disallowed and
   will fail.

A new WPT test (`popover-hint-hierarchy.html`) is added to explicitly
assert these 5 rules, and existing popover WPTs are updated to reflect
the new behavior. A virtual test suite (`popover-hint-old-behavior`)
is also added to continue testing the legacy behavior. I'm not sure
how to best handle the changed tests (and I guess the new test too)
in the context of a spec PR that is forthcoming. I'd like to be able
to publish (as a WPT PR at least) the changes, to help with the PR
effort. Suggestions appreciated.

A note about the diff: I made all of the feature flag checks look like
`if (!feature enabled) {` in the hopes that the old code would show
as unchanged in the diff, but gerrit's diff algorithm isn't great.
It's at least a little better like this than if I put the new code
first, so I left it.

Bug: 4990199
Change-Id: I41d8d96be71ba60ec5e7aa640c935258d1e33431
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7727959
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1615186}
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants