Add support for the `popover` API and for the `name` attribute on `details` elements.
Hello,
This PR initially added support for the name attribute and specifying a toggle event handler for a details element, and was extended to implement the popover API.
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 .
See also these related PRs:
Please let me know of any issues.
Cheers,
Thanks !
If I'm reading the spec right, toggle is a valid event for any popover element ... which can be any HTML element. In that case, ontoggle should be a global attribute.
Is that right ? Can you do the modification accordingly ?
Yes that is absolutely right; I had initially planned to limit the scope of this PR to the details element but following your input I decided to update it to support the popover API.
Hello @Drup what do you think of the new version?