Skip to content

Commit

Permalink
Re-do close watcher user activation tracking
Browse files Browse the repository at this point in the history
As noted in whatwg#10046, the close watcher anti-abuse measures were overly strict, and would prevent firing the cancel event even when the close watcher was created with user interaction.

Additionally, the "is grouped with previous" infrastructure used to track close watcher groups was buggy, since close watchers could be destroyed and this would cause groups to spuriously collapse.

To fix both of these problems, we re-do the close watcher anti-abuse protections. We now track the groups as a list-of-lists, and explicitly track how many groups should be allowed at a given time. We can then compare them when making decisions about whether to group a new close watcher, or whether to fire a cancel event.

Note that the initial fix proposed in whatwg#10046 (and implemented in whatwg#10048) is incorrect, as it allows indefinite trapping of the user.

Closes whatwg#10046.
  • Loading branch information
domenic authored and rubberyuzu committed Mar 21, 2024
1 parent e7ec60f commit 1882cc1
Showing 1 changed file with 173 additions and 108 deletions.
Loading

0 comments on commit 1882cc1

Please sign in to comment.