Add support for the popover API and for the name attribute on details elements.#341
Add support for the popover API and for the name attribute on details elements.#341SylvainBoilard wants to merge 1 commit intoocsigen:masterfrom
popover API and for the name attribute on details elements.#341Conversation
|
Thanks ! If I'm reading the spec right, Is that right ? Can you do the modification accordingly ? |
7ded376 to
39a391f
Compare
name and ontoggle attributes for details HTML elements.|
Yes that is absolutely right; I had initially planned to limit the scope of this PR to the |
popover API and for the name attribute on details elements.
39a391f to
48365f4
Compare
…etails>` elements. See: - https://html.spec.whatwg.org/multipage/popover.html ; - https://html.spec.whatwg.org/multipage/indices.html#event-toggle ; - https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element ; - https://developer.mozilla.org/en-US/docs/Web/API/Popover_API - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#events ; - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#attributes .
|
Hello @Drup what do you think of the new version? |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for the modern HTML Popover API and extends the details element with the name attribute, enabling named exclusive accordions. The implementation follows HTML specification and is consistent with existing library patterns.
Key Changes:
- Implements the Popover API with
popover,popovertarget, andpopovertargetactionattributes - Adds
nameattribute todetailselements for exclusive accordion groups - Introduces
toggleandbeforetoggleevent handlers for popover and details state changes
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/html_types.mli | Defines type signatures for new popover attributes (Popover, Popovertarget, Popovertargetaction), events (OnBeforeToggle, OnToggle), and extends details_attrib with Name; adds new variants (Manual, Hide, Show, Toggle) to big_variant |
| lib/html_sigs.mli | Declares function signatures for event handlers (a_onbeforetoggle, a_ontoggle) and attribute constructors (a_popover, a_popovertarget, a_popovertargetaction) |
| lib/html_f.ml | Implements event handlers and attribute constructors using existing library primitives; extends string_of_big_variant to convert new variant values to HTML-compliant strings |
| CHANGES.md | Documents the addition of popover API support and details name attribute |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hello,
This PR initially added support for the
nameattribute and specifying atoggleevent handler for adetailselement, and was extended to implement thepopoverAPI.See:
See also these related PRs:
Please let me know of any issues.
Cheers,