Bug 1860498 [wpt PR 42679] - Add invoketarget logic for popovers in button DefaultEve...
commit5445150c2579cbc38706965ad5b3620e723393c7
authorKeith Cirkel <chromium@keithcirkel.co.uk>
Wed, 8 Nov 2023 08:26:27 +0000 (8 08:26 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sun, 19 Nov 2023 15:18:41 +0000 (19 15:18 +0000)
tree201065deb7461a338afda99d5f2091f1df7964de
parent18f6eb32e13ba8586dcd0b7e1b09c4c035ef4e7e
Bug 1860498 [wpt PR 42679] - Add invoketarget logic for popovers in button DefaultEventHandler, a=testonly

Automatic update from web-platform-tests
Add invoketarget logic for popovers in button DefaultEventHandler

This adds logic on how buttons with an invoketarget pointing to an
element with `popover` should behave, based on the Invokers proposal.

See explainer section here:
https://open-ui.org/components/invokers.explainer/#defaults.

See related spec PR here: https://github.com/whatwg/html/pull/9875

This introduces new behavior just within the HTML Form Control
`DefaultEventHandler` function such that:

 - If an `invoketarget` points to an element with `popover`
    - If the `invokeaction` is `auto` or `togglePopover`, try to toggle
      the popover
    - If the `invokeaction` is `hidePopover`, try to hide the popover
    - If the `invokeaction` is `showPopover`, try to show the popover

If the `invokeaction` is none of the above, then it will fall through
the to `HandleInvokeInternal` which is passed the lowercased atom so
element subclasses can handle their individual behaviors.

Bug: 1494737
Change-Id: Id2ab6faf8782a0fe0ba5c9f05ff562fee640f8b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4964940
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Luke <lukewarlow156@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1215820}

--

wpt-commits: a86d7454b3b6c8e33fed6a05b08ff081d62bf680
wpt-pr: 42679
testing/web-platform/tests/html/semantics/invokers/invoketarget-on-popover-behavior.tentative.html [new file with mode: 0644]