From e41f54e0f6e2574f7af0efe54fa9266df3215d47 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 6 Feb 2024 18:31:53 -0800 Subject: [PATCH] Hide all popovers when beforetoggle shows a popover See http://crrev.com/c/5141430: It was previously possible to hit some underspecified behavior with something like this:
Popover 1
Popover 2
The problem is that "hide all popovers until" doesn't end up with the desired "until" popover on the top of the stack in this case. There is already a similar situation within the "hide all..." algorithm itself, but that only handles the case where a popover being hidden by "hide all..." has the beforetoggle listener. This is the same problem, but for the case that the "until" popover has that listener. --- source | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source b/source index 9f6f2489f80..d373caac6c9 100644 --- a/source +++ b/source @@ -84611,6 +84611,10 @@ dictionary DragEventInit : MouseEventInit { +
  • Let autoPopoverListContainsElement be true if document's + showing auto popover list's last item is element, otherwise + false.

  • +
  • Set element's popover invoker to null.

  • @@ -84623,6 +84627,11 @@ dictionary DragEventInit : MouseEventInit { data-x="">open" and the newState attribute initialized to "closed" at element.

  • +
  • If autoPopoverListContainsElement is true and document's + showing auto popover list's last item is not element, then run hide all popovers until given element, + focusPreviousElement, and false.

  • +
  • If the result of running check popover validity given element, true, throwExceptions, and null is false, then run cleanupSteps and @@ -84702,6 +84711,10 @@ dictionary DragEventInit : MouseEventInit { focusPreviousElement, and a boolean fireEvents:

      +
    1. If endpoint is an HTML element and + endpoint is not in the popover showing + state, then return.

    2. +
    3. Let document be endpoint's node document.