-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix corner case invoker issue with popover nested inside invoker #10770
Conversation
In this situation: ``` <button popovertarget=foo>Activate <div popover id=foo>Clicking me shouldn't close me</div> </button> ``` clicking the button properly activates the popover, however, clicking on the popover itself after that should **not** close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed. This patch fixes that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
In this case: ``` <button popovertarget=foo>Activate <div popover id=foo>Clicking me shouldn't close me</div> </button> ``` clicking the button properly activates the popover, however, clicking on the popover itself after that should **not** close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed. This CL changes that behavior so that clicks on the popover in the case above no longer re-invoke the popover. Spec PR: whatwg/html#10770 Bug: 379241451 Change-Id: Iab67127c46a97a081a7818bfd917864729bf8b5c
In this case: ``` <button popovertarget=foo>Activate <div popover id=foo>Clicking me shouldn't close me</div> </button> ``` clicking the button properly activates the popover, however, clicking on the popover itself after that should **not** close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed. This CL changes that behavior so that clicks on the popover in the case above no longer re-invoke the popover. Spec PR: whatwg/html#10770 Bug: 379241451 Change-Id: Iab67127c46a97a081a7818bfd917864729bf8b5c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026982 Auto-Submit: Mason Freed <[email protected]> Commit-Queue: Mason Freed <[email protected]> Reviewed-by: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1384498}
In this case: ``` <button popovertarget=foo>Activate <div popover id=foo>Clicking me shouldn't close me</div> </button> ``` clicking the button properly activates the popover, however, clicking on the popover itself after that should **not** close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed. This CL changes that behavior so that clicks on the popover in the case above no longer re-invoke the popover. Spec PR: whatwg/html#10770 Bug: 379241451 Change-Id: Iab67127c46a97a081a7818bfd917864729bf8b5c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026982 Auto-Submit: Mason Freed <[email protected]> Commit-Queue: Mason Freed <[email protected]> Reviewed-by: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1384498}
…ained within invokers, a=testonly Automatic update from web-platform-tests Implement new behavior for popovers contained within invokers In this case: ``` <button popovertarget=foo>Activate <div popover id=foo>Clicking me shouldn't close me</div> </button> ``` clicking the button properly activates the popover, however, clicking on the popover itself after that should **not** close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed. This CL changes that behavior so that clicks on the popover in the case above no longer re-invoke the popover. Spec PR: whatwg/html#10770 Bug: 379241451 Change-Id: Iab67127c46a97a081a7818bfd917864729bf8b5c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026982 Auto-Submit: Mason Freed <[email protected]> Commit-Queue: Mason Freed <[email protected]> Reviewed-by: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; will let @annevk review again if he's interested, and then we can merge when the template is filled out.
Thanks! I filled out the rest of the template. |
…ained within invokers, a=testonly Automatic update from web-platform-tests Implement new behavior for popovers contained within invokers In this case: ``` <button popovertarget=foo>Activate <div popover id=foo>Clicking me shouldn't close me</div> </button> ``` clicking the button properly activates the popover, however, clicking on the popover itself after that should **not** close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed. This CL changes that behavior so that clicks on the popover in the case above no longer re-invoke the popover. Spec PR: whatwg/html#10770 Bug: 379241451 Change-Id: Iab67127c46a97a081a7818bfd917864729bf8b5c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026982 Auto-Submit: Mason Freed <[email protected]> Commit-Queue: Mason Freed <[email protected]> Reviewed-by: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232
…ained within invokers, a=testonly Automatic update from web-platform-tests Implement new behavior for popovers contained within invokers In this case: ``` <button popovertarget=foo>Activate <div popover id=foo>Clicking me shouldn't close me</div> </button> ``` clicking the button properly activates the popover, however, clicking on the popover itself after that should **not** close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed. This CL changes that behavior so that clicks on the popover in the case above no longer re-invoke the popover. Spec PR: whatwg/html#10770 Bug: 379241451 Change-Id: Iab67127c46a97a081a7818bfd917864729bf8b5c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026982 Auto-Submit: Mason Freed <[email protected]> Commit-Queue: Mason Freed <[email protected]> Reviewed-by: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232
In this situation:
clicking the button properly activates the popover, however, clicking on the popover itself after that should not close the popover. It currently does, because the popover click bubbles to the
<button>
and activates the invoker, which toggles the popover closed.This patch fixes that case by checking that the invoke event wasn't on the popover itself.
(See WHATWG Working Mode: Changes for more details.)
/form-elements.html ( diff )
/input.html ( diff )
/popover.html ( diff )