LibWeb: Implement popover methods

Implements basics of showPopover, hidePopover and togglePopover.
This commit is contained in:
Luke Warlow 2024-12-05 23:24:24 +00:00 committed by Tim Ledbetter
commit eb1c60f37b
Notes: github-actions[bot] 2024-12-06 12:40:09 +00:00
12 changed files with 480 additions and 5 deletions

View file

@ -34,9 +34,9 @@ interface HTMLElement : Element {
ElementInternals attachInternals();
// The popover API
[FIXME] undefined showPopover();
[FIXME] undefined hidePopover();
[FIXME] boolean togglePopover(optional boolean force);
[ImplementedAs=show_popover_for_bindings] undefined showPopover(optional ShowPopoverOptions options = {});
[ImplementedAs=hide_popover_for_bindings] undefined hidePopover();
boolean togglePopover(optional (TogglePopoverOptions or boolean) options = {});
[CEReactions] attribute DOMString? popover;
// https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
@ -48,6 +48,16 @@ interface HTMLElement : Element {
};
// https://html.spec.whatwg.org/multipage/dom.html#showpopoveroptions
dictionary ShowPopoverOptions {
HTMLElement source;
};
// https://html.spec.whatwg.org/multipage/dom.html#togglepopoveroptions
dictionary TogglePopoverOptions : ShowPopoverOptions {
boolean force;
};
HTMLElement includes GlobalEventHandlers;
HTMLElement includes ElementContentEditable;
HTMLElement includes HTMLOrSVGElement;