-
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
…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 <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232 UltraBlame original commit: 1bc5ed8ce26d83713b264aae65068e3c8de79546
…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 <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232 UltraBlame original commit: 1bc5ed8ce26d83713b264aae65068e3c8de79546
…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 <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232 UltraBlame original commit: 1bc5ed8ce26d83713b264aae65068e3c8de79546
…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
…-button test, a=testonly Automatic update from web-platform-tests Remove .tentative from popover-nested-in-button test Spec PR: whatwg/html#10770 -- wpt-commits: d8bd5c4ede4a4548950435d135e85ed52468778a wpt-pr: 49241
…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
…-button test, a=testonly Automatic update from web-platform-tests Remove .tentative from popover-nested-in-button test Spec PR: whatwg/html#10770 -- wpt-commits: d8bd5c4ede4a4548950435d135e85ed52468778a wpt-pr: 49241
…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 <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232 UltraBlame original commit: 9ef5f6532921cb390f6bb6a414f9d7a989e859d3
…-button test, a=testonly Automatic update from web-platform-tests Remove .tentative from popover-nested-in-button test Spec PR: whatwg/html#10770 -- wpt-commits: d8bd5c4ede4a4548950435d135e85ed52468778a wpt-pr: 49241 UltraBlame original commit: 8882e5746d1dc531c6d8054452b50f9ff4e5ca9a
…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 <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232 UltraBlame original commit: 9ef5f6532921cb390f6bb6a414f9d7a989e859d3
…-button test, a=testonly Automatic update from web-platform-tests Remove .tentative from popover-nested-in-button test Spec PR: whatwg/html#10770 -- wpt-commits: d8bd5c4ede4a4548950435d135e85ed52468778a wpt-pr: 49241 UltraBlame original commit: 8882e5746d1dc531c6d8054452b50f9ff4e5ca9a
…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 <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: David Baron <dbaronchromium.org> Cr-Commit-Position: refs/heads/main{#1384498} -- wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8 wpt-pr: 49232 UltraBlame original commit: 9ef5f6532921cb390f6bb6a414f9d7a989e859d3
…-button test, a=testonly Automatic update from web-platform-tests Remove .tentative from popover-nested-in-button test Spec PR: whatwg/html#10770 -- wpt-commits: d8bd5c4ede4a4548950435d135e85ed52468778a wpt-pr: 49241 UltraBlame original commit: 8882e5746d1dc531c6d8054452b50f9ff4e5ca9a
https://bugs.webkit.org/show_bug.cgi?id=283494 Reviewed by NOBODY (OOPS!). This patch matches the new spec behaviour for when a popover is inside its invoker. See whatwg/html#10770 * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-nested-in-button-expected.txt: * Source/WebCore/html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler): * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::handlePopoverTargetAction const): * Source/WebCore/html/HTMLFormControlElement.h: * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
https://bugs.webkit.org/show_bug.cgi?id=283494 Reviewed by NOBODY (OOPS!). This patch matches the new spec behaviour for when a popover is inside its invoker. See whatwg/html#10770 * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-nested-in-button-expected.txt: * Source/WebCore/html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler): * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::handlePopoverTargetAction const): * Source/WebCore/html/HTMLFormControlElement.h: * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
https://bugs.webkit.org/show_bug.cgi?id=283494 Reviewed by Tim Nguyen. This patch matches the new spec behaviour for when a popover is inside its invoker. See whatwg/html#10770 * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-nested-in-button-expected.txt: * Source/WebCore/html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler): * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::handlePopoverTargetAction const): * Source/WebCore/html/HTMLFormControlElement.h: * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): Canonical link: https://commits.webkit.org/287522@main
https://bugs.webkit.org/show_bug.cgi?id=283494 Reviewed by Tim Nguyen. This patch matches the new spec behaviour for when a popover is inside its invoker. See whatwg/html#10770 * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-nested-in-button-expected.txt: * Source/WebCore/html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler): * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::handlePopoverTargetAction const): * Source/WebCore/html/HTMLFormControlElement.h: * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): Canonical link: https://commits.webkit.org/287522@main
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 )