Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add invoketarget logic for popovers in button DefaultEventHandler #42679

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Oct 23, 2023

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: whatwg/html#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 <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Luke <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1215820}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-4964940 branch 5 times, most recently from ef6c78d to 44eb22a Compare October 26, 2023 21:35
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: whatwg/html#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 <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Luke <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1215820}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit a86d745 into master Oct 26, 2023
14 of 18 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-4964940 branch October 26, 2023 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants