Skip to content

Simplify popover=hint behaviours & related spec fixes#12345

Open
jakearchibald wants to merge 10 commits intomainfrom
jakearchibald/popover-hint-simpler-behaviours
Open

Simplify popover=hint behaviours & related spec fixes#12345
jakearchibald wants to merge 10 commits intomainfrom
jakearchibald/popover-hint-simpler-behaviours

Conversation

@jakearchibald
Copy link
Copy Markdown
Collaborator

@jakearchibald jakearchibald commented Apr 8, 2026

  • At least two implementers are interested (and none opposed):
    • Mozilla
    • Google
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)

Fixes #12304

  • Add stuff to infra & use it
  • Decide on & spec auto-in-hint behaviour
  • Decide on & spec what happens with popovers shown during beforetoggle-hide.
  • Review new tests & add more if needed
  • Apply wrapping

/interactive-elements.html ( diff )
/popover.html ( diff )

<p>To <dfn export data-x="hide-all-popovers-until">hide all popovers until</dfn>, given an <span
data-x="HTML elements">HTML element</span> or <code>Document</code> <var>endpoint</var>, a boolean
<var>focusPreviousElement</var>, and a boolean <var>fireEvents</var>:</p>
<p>To <dfn>hide popover stack until</dfn>, given an <span data-x="html elements">HTML
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This needed a rewrite. The previous version looped the wrong way, and assumed popoverList was 'live'.

@jakearchibald
Copy link
Copy Markdown
Collaborator Author

jakearchibald commented Apr 8, 2026

I'll sort out the wrapping after reviews & changes.

@jakearchibald jakearchibald marked this pull request as ready for review April 8, 2026 14:01
@lukewarlow
Copy link
Copy Markdown
Member

Btw https://github.com/domfarolino/specfmt is quite useful for the wrapping.

@jakearchibald
Copy link
Copy Markdown
Collaborator Author

@lukewarlow haha your deleted comment did reveal a bug! It wasn't the return false that was wrong, but I was missing a return true.

@jakearchibald
Copy link
Copy Markdown
Collaborator Author

jakearchibald commented Apr 8, 2026

av1.mp4

@mfreed7 sorry for another video, but I don't think I'd be able to describe it well. What do you see as the intended behaviour here?

https://random-stuff.jakearchibald.com/bug-repros/popover-show-on-hide-warning/ - here's the demo page.

Edit: I'm not convinced my spec totally solves this either, as hiding a popover hides child popovers, which would include the new ones added, and they'd be hidden with events. Maybe.

<var>focusPreviousElement</var>, and a boolean <var>fireEvents</var>:</p>
<p>To <dfn>hide popover stack until</dfn>, given an <span data-x="html elements">HTML
element</span> or null <var>endpoint</var>, <code>Document</code> <var>document</var>,
an <span data-x="attr-popover-auto-state">Auto</span> or <span data-x="attr-popover-hint-state">Hint</span> <var>stackType</var>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess we have precedent for using attribute state as a parameter and it's probably reasonable as it's the result of a computation so doesn't depend on any other state.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I was unsure about this. I don't mind doing something else.

data-x="attr-popover-auto-state">Auto</span> state or <var>endpoint</var>'s <code
data-x="attr-popover">popover</code> attribute is in the <span
data-x="attr-popover-hint-state">Hint</span> state.</p></li>
<li><p>Reverse <var>toHide</var>.</p></li>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reverse also needs an issue or link if it already exists.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reminder to self: When I incorporate this, it returns a new list rather than mutating the current list.

@jakearchibald
Copy link
Copy Markdown
Collaborator Author

@mfreed7 can you create a PR for your tests so far?

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

popover=hint has multiple weird and inconsistent behaviours

3 participants