Skip to content

Commit

Permalink
Bug 1817482 [wpt PR 38571] - Stop bubbling for popover toggle events,…
Browse files Browse the repository at this point in the history
… a=testonly

Automatic update from web-platform-tests
Stop bubbling for popover toggle events

Per the discussion at [1], this was an oversight and popover toggle
events (`beforetoggle` and `toggle`) should not bubble.

[1] whatwg/html#8888

Closes: whatwg/html#8888

Bug: 1307772
Change-Id: I29e286a6f9a8bcd1d725fa85e200a388bde0323c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4263380
Commit-Queue: Joey Arhar <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1106907}

--

wpt-commits: fec55c3d5937edb83f2b95ee5137669f7781124b
wpt-pr: 38571
  • Loading branch information
mfreed7 authored and moz-wptsync-bot committed Mar 2, 2023
1 parent 3d5226f commit 9ac20f4
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
window.onload = () => {
for(const method of ["listener","attribute"]) {
promise_test(async t => {
const popover = document.querySelector('[popover]');
const {popover,signal} = getPopoverAndSignal(t);
assert_false(popover.matches(':open'));
let showCount = 0;
let afterShowCount = 0;
Expand Down Expand Up @@ -59,10 +59,9 @@
};
switch (method) {
case "listener":
const {signal} = getPopoverAndSignal(t);
// These events bubble.
document.addEventListener('beforetoggle', listener, {signal});
document.addEventListener('toggle', listener, {signal});
// These events do *not* bubble.
popover.addEventListener('beforetoggle', listener, {signal});
popover.addEventListener('toggle', listener, {signal});
break;
case "attribute":
assert_false(popover.hasAttribute('onbeforetoggle'));
Expand Down

0 comments on commit 9ac20f4

Please sign in to comment.