From ea851d1e887d1aaecffa7652a01e215557b62fd4 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 14 Feb 2023 13:09:30 -0800 Subject: [PATCH 1/5] Add "hide all popovers" algorithm This was requested for cross referencing instead of "hide all popovers until" here: https://github.com/whatwg/fullscreen/pull/204#discussion_r1031644895 This patch also fixes a bug where a null endpoint is passed to hide all popovers until, but hide all popovers until assumes endpoint is not null by looking for endpoint's node document. The bug is fixed by adding a required document parameter to hide all popovers until. --- source | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/source b/source index fc4e4b22353..737bb2c7c36 100644 --- a/source +++ b/source @@ -59600,8 +59600,8 @@ interface HTMLDialogElement : HTMLElement { and a boolean isModal, are as follows:

    -
  1. Run hide all popovers until given null, - false, and false.

  2. +
  3. Run hide all popovers given subject's node + document.

  4. Let control be null.

  5. @@ -81438,7 +81438,8 @@ dictionary DragEventInit : MouseEventInit { ancestor algorithm given element.

  6. Run hide all popovers until given - ancestor, false, and false.

  7. + ancestor's node document, ancestor, false, and + false.

  8. If originalType is not equal to the value of element's DragEventInit : MouseEventInit {

    1. Run hide all popovers until given - element, focusPreviousElement, and - dontFireEvents.

    2. + element's node document, element, + focusPreviousElement, and dontFireEvents.

    3. If element is not in document's auto popover list:

      @@ -81655,13 +81656,12 @@ dictionary DragEventInit : MouseEventInit { given this and true.

    -

    To hide all popovers until, given an HTML element endpoint, a boolean - focusPreviousElement, and a boolean dontFireEvents:

    +

    To hide all popovers until, given a + Document document, an HTML element or + null endpoint, a boolean focusPreviousElement, and a boolean + dontFireEvents:

      -
    1. Let document be endpoint's node document.

    2. -
    3. Let closeAllOpenPopovers be an algorithm which performs the following steps:

      @@ -81723,6 +81723,10 @@ dictionary DragEventInit : MouseEventInit { happens. For example, during light-dismiss of a popover, this algorithm ensures that we close only the popovers that aren't related to the node clicked by the user.

      +

      To hide all popovers, given a Document document, run + hide all popovers until given document, + null, false, and false.

      +

      To find the topmost popover ancestor, given a Node newPopover, perform the following steps. They return an HTML element or null.

      @@ -82121,7 +82125,8 @@ dictionary DragEventInit : MouseEventInit {
    4. Set document's popover pointerdown target to null.

    5. If sameTarget is true, then run hide - all popovers until given ancestor, false, and false.

    6. + all popovers until given ancestor's node document, + ancestor, false, and false.

From 0b7026f1ed078dd37709ad2aacf01c853006c369 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 14 Feb 2023 12:49:32 -0800 Subject: [PATCH 2/5] Export some popover dfns These dfns need to be exported in order to be used in the fullscreen spec: https://github.com/whatwg/fullscreen/pull/204 --- source | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source b/source index f2b1ad0c18f..e92ca63bea2 100644 --- a/source +++ b/source @@ -81489,14 +81489,16 @@ dictionary DragEventInit : MouseEventInit { must reflect the popover attribute, limited to only known values.

-

Every HTML element has a popover visibility +

Every HTML element has a popover visibility state, initially hidden, with these potential values:

    -
  • hidden

  • +
  • hidden

  • -
  • showing

  • +
  • showing

The Document has an auto popover list, which is a list, From 24d0b5f482700174c719f9cffa0fe90834edddb5 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Fri, 17 Feb 2023 09:26:07 -0800 Subject: [PATCH 3/5] use for instead of data-dfn-for --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index e92ca63bea2..ceadc0b667d 100644 --- a/source +++ b/source @@ -81494,10 +81494,10 @@ dictionary DragEventInit : MouseEventInit { values:

    -
  • hidden

  • -
  • showing

From 84397e3e107bc8617345b4a9c2f00aacbd4dff54 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 22 Feb 2023 08:44:16 -0800 Subject: [PATCH 4/5] add null checks and replace comma --- source | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source b/source index ceadc0b667d..272702460c5 100644 --- a/source +++ b/source @@ -81624,6 +81624,9 @@ dictionary DragEventInit : MouseEventInit {
  • Let ancestor be the result of running the topmost popover ancestor algorithm given element.

  • +
  • If ancestor is null, then set ancestor to + document.

  • +
  • Run hide all popovers until given ancestor, false, and true.

  • @@ -81846,7 +81849,7 @@ dictionary DragEventInit : MouseEventInit { focusPreviousElement, and a boolean fireEvents:

      -
    1. Let document be endpoint if endpoint is a Document, +

    2. Let document be endpoint if endpoint is a Document; otherwise endpoint's node document.

    3. @@ -81912,7 +81915,7 @@ dictionary DragEventInit : MouseEventInit {

      To hide all popovers, given a Document document, run hide all popovers until given document, - null, false, and false.

      + false, and false.

      To find the topmost popover ancestor, given a Node newPopover, perform the following steps. They return an hide all popovers until given ancestor, false, and true.

    From dd1c487981ff0d95bde289ee716ca8b412c22e12 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 22 Feb 2023 15:43:51 -0800 Subject: [PATCH 5/5] simplify node document --- source | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source b/source index 272702460c5..dc4bbfd098b 100644 --- a/source +++ b/source @@ -81849,8 +81849,7 @@ dictionary DragEventInit : MouseEventInit { focusPreviousElement, and a boolean fireEvents:

      -
    1. Let document be endpoint if endpoint is a Document; - otherwise endpoint's node document.

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

    4. Let closeAllOpenPopovers be an algorithm which performs the following steps: