From 4a93ad6171fff4059047bf92821cea7361c6e0fe Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 31 Oct 2024 10:49:27 -0700 Subject: [PATCH 01/17] Add closedby attribute to First commit is pulled from https://github.com/whatwg/html/pull/10157 --- source | 221 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 218 insertions(+), 3 deletions(-) diff --git a/source b/source index 667b17a3a94..e7aea80dd6d 100644 --- a/source +++ b/source @@ -61577,6 +61577,7 @@ interface HTMLDetailsElement : HTMLElement {
Flow content.
Content attributes:
Global attributes
+
closedby
open
Accessibility considerations:
@@ -61590,6 +61591,7 @@ interface HTMLDialogElement : HTMLElement { [CEReactions] attribute boolean open; attribute DOMString returnValue; + [CEReactions] attribute DOMString closedBy; [CEReactions] undefined show(); [CEReactions] undefined showModal(); [CEReactions] undefined close(optional DOMString returnValue); @@ -61685,6 +61687,38 @@ interface HTMLDialogElement : HTMLElement { is a boolean attribute. When specified, it indicates that the dialog element is active and that the user can interact with it.

+

The closedby + content attribute is an enumerated attribute with the following keywords and + states:

+ + + + + + + + +
Keyword + State + Brief description +
any + Any + Close requests or clicking outside closes the dialog. +
closerequest + Close Request + Close requests close the dialog. +
none + None + Nothing automatically closes the dialog. +
+ +

The closedby attribute's invalid value default and missing value + default are both the Auto state. The auto state matches closerequest when the element is modal; + otherwise none.

+

A dialog element without an open attribute @@ -61819,6 +61853,27 @@ interface HTMLDialogElement : HTMLElement {

  • Add an open attribute to this, whose value is the empty string.

  • +
  • +

    Set this's close watcher to the + result of establishing a close watcher given + this's relevant global object, with:

    + +
      +
    • cancelAction being to return the + result of firing an event named cancel at this, with the cancelable attribute initialized to true.

    • + +
    • closeAction being to close the + dialog given this and null.

    • + +
    • enabled being true if this's + closedby attribute state is Any or Close Request; otherwise false.

    • +
    +
  • +
  • Set this's previously focused element to the focused element.

  • @@ -61909,6 +61964,12 @@ interface HTMLDialogElement : HTMLElement {
  • closeAction being to close the dialog given this and null.

  • + +
  • enabled being true if this's + closedby attribute is in the Any, Close Request, or Auto state; otherwise false.

  • @@ -62113,6 +62174,9 @@ interface HTMLDialogElement : HTMLElement {
    +

    The Document has a dialog pointerdown target, which is an HTML dialog element or null, initially null.

    +

    Each dialog element has a close watcher, which is a close watcher or null, initially null.

    @@ -62127,8 +62191,42 @@ interface HTMLDialogElement : HTMLElement { attribute set this element to the currently focused element during the show popover algorithm.

    +

    The following attribute change + steps, given element, localName, oldValue, + value, and namespace, are used for HTML + dialog elements:

    + +
      +
    1. If namespace is not null, then return.

    2. + +
    3. If localName is not closedby, then + return.

    4. + +
    5. If element has no open attribute, then + return.

    6. + +
    7. If oldValue and value are in the same state, then return.

    8. + +
    9. Assert: element's close + watcher is not null.

    10. + +
    11. If value is in the Any state, + or Close Request state, + or Auto state and element's is + modal flag is true, then let enabled to true; otherwise false.

    12. + +
    13. Set element's close watcher's enabled boolean to enabled.

    14. +
    +
    +

    The closedBy IDL attribute must reflect the + closedby content attribute, limited to only + known values.

    +

    The open IDL attribute must reflect the open content attribute.

    @@ -62149,7 +62247,110 @@ interface HTMLDialogElement : HTMLElement { </dialog>
    +

    Dialog light dismiss

    + +

    "Light dismiss" means that clicking outside of a dialog whose closedby attribute is in the any state will close the dialog. This is in addition to + how such dialogs respond to close requests.

    + +

    To light dismiss open dialogs, given an Event event:

    + +
      +
    1. Assert: event's isTrusted attribute is true.

    2. + +
    3. Let target be event's target.

    4. + +
    5. Let document be target's node document.

    6. + +
    7. If document's showing any dialog list is empty, then + return.

    8. + +
    9. If event is a PointerEvent and event's type is "pointerdown", + then: set document's dialog pointerdown target to the result of running + topmost clicked dialog given target.

    10. + +
    11. +

      If event is a PointerEvent and event's type is "pointerup", + then:

      + +
        +
      1. Let clickedDialog be the result of running topmost clicked + dialog given target.

      2. + +
      3. Let topDialog be document's showing any dialog + list's last element.

      4. +
      5. Let clickedTopDialog be clickedDialog is topDialog, or + clickedDialog is dialog pointerdown target

      6. + +
      7. Set document's dialog pointerdown target to null.

      8. + +
      9. If clickedTopDialog, then return.

      10. + +
      11. Perform close the dialog given topDialog.

      12. +
      +
    12. +
    + +

    Light dismiss open dialogs will be called by the Pointer Events spec when the user clicks + or touches anywhere on the page.

    + +

    To find the topmost clicked dialog, given a Node node:

    + +
      +
    1. Let clickedDialog be the result of running nearest inclusive open + dialog given node.

    2. + +
    3. Return clickedDialog.

    4. +
    + +

    To get the showing any dialog list for a + Document document:

    + +
      +
    1. Let dialogs be « ».

    2. + +
    3. For each Element element in + document's top layer: if element is a dialog element, element's closedby attribute is in the any state and element has an open attribute, then append + element to dialogs.

    4. + +
    5. Return dialogs.

    6. +
    + +

    To find the nearest inclusive open dialog given a Node + node, perform the following steps. They return an HTML dialog element or null.

    + +
      +
    1. Let currentNode be node.

    2. + +
    3. +

      While currentNode is not null:

      + +
        +
      1. If currentNode is an HTML dialog + element, currentNode's closedby + attribute is in the any state and + currentNode has an open attribute, then + return currentNode.

      2. + +
      3. Set currentNode to currentNode's parent in the flat + tree.

      4. +
      +
    4. + +
    5. Return null.

    6. +

    Scripting

    @@ -82838,6 +83039,8 @@ body { display:none }
  • An is running cancel action boolean.

  • + +
  • An enabled boolean.

  • A close watcher closeWatcher is @@ -82848,8 +83051,10 @@ body { display:none }


    To establish a close watcher given a Window window, a list - of steps cancelAction, and a - list of steps closeAction:

    + of steps cancelAction, a + list of steps closeAction, + and an optional boolean enabled + (default true):

    1. Assert: window's is running cancel action

      false
      + +
      enabled
      +
      enabled
    2. @@ -82910,6 +83118,9 @@ body { display:none }
    3. If closeWatcher is not active, then return true.

    4. +
    5. If closeWatcher's enabled is false, + then return true.

    6. +
    7. If closeWatcher's is running cancel action is true, then return true.

    8. @@ -82964,6 +83175,9 @@ body { display:none }
    9. If closeWatcher is not active, then return.

    10. +
    11. If closeWatcher's enabled is false, + then return true.

    12. +
    13. If closeWatcher's window's associated Document is not fully active, then return.

    14. @@ -83011,7 +83225,8 @@ body { display:none } in reverse order:

        -
      1. Set processedACloseWatcher to true.

      2. +
      3. If closeWatcher's enabled is + true, set processedACloseWatcher to true.

      4. Let shouldProceed be the result of requesting to close From 3630019067fbf221a662b4aaf36756fc05886034 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 31 Oct 2024 15:07:15 -0700 Subject: [PATCH 02/17] Small tweaks --- source | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/source b/source index e7aea80dd6d..8a29d835013 100644 --- a/source +++ b/source @@ -61701,15 +61701,15 @@ interface HTMLDialogElement : HTMLElement { any Any - Close requests or clicking outside closes the dialog. + Close requests (e.g. user hitting ESC) or clicking outside closes the dialog. closerequest Close Request - Close requests close the dialog. + Close requests (e.g. user hitting ESC) close the dialog. none None - Nothing automatically closes the dialog. + No user actions automatically close the dialog.

        The closedby attribute's Light dismiss open dialogs will be called by the Pointer Events spec when the user clicks + href="https://github.com/w3c/pointerevents/pull/460">Pointer Events spec when the user clicks or touches anywhere on the page.

        To find the topmost clicked dialog, given a Node node:

        @@ -62310,17 +62313,17 @@ interface HTMLDialogElement : HTMLElement {
      5. Return clickedDialog.

      -

      To get the showing any dialog list for a +

      To get the light dismissible dialog list for a Document document:

      1. Let dialogs be « ».

      2. For each Element element in - document's top layer: if element is a document: if element is a dialog element, element's closedby attribute is in the any state and element has an any state, and element has the open attribute, then append element to dialogs.

      3. From 32c2240293a2d87b71f7fdd57d729d495a4fcf77 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 31 Oct 2024 15:57:59 -0700 Subject: [PATCH 03/17] Add requestClose() --- source | 63 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/source b/source index 8a29d835013..3c7c767dd65 100644 --- a/source +++ b/source @@ -61595,6 +61595,7 @@ interface HTMLDialogElement : HTMLElement { [CEReactions] undefined show(); [CEReactions] undefined showModal(); [CEReactions] undefined close(optional DOMString returnValue); + [CEReactions] undefined requestClose(optional DOMString returnValue); };
        Uses HTMLDialogElement.
        @@ -61701,7 +61702,8 @@ interface HTMLDialogElement : HTMLElement { any Any - Close requests (e.g. user hitting ESC) or clicking outside closes the dialog. + Close requests (e.g. user hitting ESC) or clicking + outside closes the dialog. closerequest Close Request @@ -61772,6 +61774,13 @@ interface HTMLDialogElement : HTMLElement {

        The argument, if provided, provides a return value.

        +
        dialog.requestClose([ result ])
        +
        +

        Requests the closure of the dialog element.

        + +

        The argument, if provided, provides a return value.

        +
        +
        dialog.returnValue [ = result ]

        Returns the dialog's return value.

        @@ -62060,6 +62069,17 @@ interface HTMLDialogElement : HTMLElement {
      4. Close the dialog this with returnValue.

      +

      The requestClose(returnValue) method steps + are: + +

        +
      1. If returnValue is not given, then set it to null.

      2. + +
      3. Request to close the dialog with this and + returnValue.

      4. +
      +

      When a dialog element subject is to be closed, with null or a string result, run these steps:

      @@ -62285,7 +62305,7 @@ interface HTMLDialogElement : HTMLElement {
    15. Let topDialog be document's light dismissible dialog list's last element.

    16. -
    17. Let sameTarget be true if var>clickedDialog is dialog pointerdown +

    18. Let sameTarget be true if clickedDialog is dialog pointerdown target.

    19. Let clickedTopDialog be true if clickedDialog is @@ -62295,14 +62315,36 @@ interface HTMLDialogElement : HTMLElement {

    20. If clickedTopDialog is true or sameTarget is false, then return.

    21. -
    22. Perform close the dialog given topDialog.

    23. +
    24. Perform request to close the dialog given topDialog.

    -

    Light dismiss open dialogs will be called by the Pointer Events spec when the user clicks - or touches anywhere on the page.

    +

    To run light dismiss activities, given an Event event:

    + +
      +
    1. Run Light dismiss open dialogs with event.

    2. + +
    3. Run Light dismiss open popovers with event.

    4. + +

      Run light dismiss activities will be called by the Pointer Events spec when the user clicks + or touches anywhere on the page.

      +
    + +

    To request to close the dialog, given a dialog element + dialog and a DOMString returnValue:

    + +
      +
    1. Let notCanceled be the result of firing an event named cancel at + dialog, with the cancelable attribute + initialized to true.

    2. + +
    3. If notCanceled is false, return.

    4. + +
    5. Close the dialog given dialog and returnValue.

    6. +

    To find the topmost clicked dialog, given a Node node:

    @@ -62320,9 +62362,8 @@ interface HTMLDialogElement : HTMLElement {
  • Let dialogs be « ».

  • For each Element element in - document: if element is a dialog element, element's closedby attribute is in the document: if element is a dialog element, + element's closedby attribute is in the any state, and element has the open attribute, then append element to dialogs.

  • @@ -86680,10 +86721,6 @@ dictionary DragEventInit : MouseEventInit { -

    Light dismiss open popovers will be called by the Pointer Events spec when the user clicks - or touches anywhere on the page.

    -

    To find the topmost clicked popover, given a Node node:

      From 78f9789db6167a62ab9f7b8e16b8a2b0f8471f5b Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 31 Oct 2024 16:08:26 -0700 Subject: [PATCH 04/17] Fix tag nesting --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index 3c7c767dd65..5ebe916312b 100644 --- a/source +++ b/source @@ -62071,7 +62071,7 @@ interface HTMLDialogElement : HTMLElement {

      The requestClose(returnValue) method steps - are: + are:

      1. If returnValue is not given, then set it to null.

      2. @@ -62305,7 +62305,7 @@ interface HTMLDialogElement : HTMLElement {
      3. Let topDialog be document's light dismissible dialog list's last element.

      4. -
      5. Let sameTarget be true if clickedDialog is dialog pointerdown +

      6. Let sameTarget be true if clickedDialog is dialog pointerdown target.

      7. Let clickedTopDialog be true if clickedDialog is @@ -62313,7 +62313,7 @@ interface HTMLDialogElement : HTMLElement {

      8. Set document's dialog pointerdown target to null.

      9. -
      10. If clickedTopDialog is true or sameTarget is false, then return.

      11. +
      12. If clickedTopDialog is true or sameTarget is false, then return.

      13. Perform request to close the dialog given topDialog.

      @@ -62333,7 +62333,7 @@ interface HTMLDialogElement : HTMLElement {

    To request to close the dialog, given a dialog element - dialog and a DOMString returnValue:

    + dialog and a string returnValue:

    1. Let notCanceled be the result of Date: Fri, 1 Nov 2024 09:09:02 -0700 Subject: [PATCH 05/17] Move note out of OL --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index 5ebe916312b..ad01f070087 100644 --- a/source +++ b/source @@ -62326,12 +62326,12 @@ interface HTMLDialogElement : HTMLElement {

    2. Run Light dismiss open dialogs with event.

    3. Run Light dismiss open popovers with event.

    4. - -

      Run light dismiss activities will be called by the Pointer Events spec when the user clicks - or touches anywhere on the page.

    +

    Run light dismiss activities will be called by the Pointer Events spec when the user clicks + or touches anywhere on the page.

    +

    To request to close the dialog, given a dialog element dialog and a string returnValue:

    From 8698d0b61fdd93d638dddbd577bfa5c11a2fb106 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 7 Nov 2024 17:34:22 -0800 Subject: [PATCH 06/17] Address comments --- source | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source b/source index ad01f070087..0d291d84af1 100644 --- a/source +++ b/source @@ -61701,25 +61701,25 @@ interface HTMLDialogElement : HTMLElement { any - Any - Close requests (e.g. user hitting ESC) or clicking - outside closes the dialog. + any + Close requests (e.g. user hitting ESC) or clicks + outside close the dialog. closerequest - Close Request + close request Close requests (e.g. user hitting ESC) close the dialog. none - None + none No user actions automatically close the dialog.

    The closedby attribute's invalid value default and missing value - default are both the Auto state. The are both the auto state. The auto state matches closerequest when the element is modal; - otherwise none.

    + data-x="attr-closedby-closerequest-state">close request state when the element is modal; + otherwise the none state.

    From f50198e60bb1798d2abebfc3908abe846c2bda40 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 7 Nov 2024 17:37:12 -0800 Subject: [PATCH 07/17] Check for open attribute --- source | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source b/source index 0d291d84af1..295cc002ede 100644 --- a/source +++ b/source @@ -62074,6 +62074,9 @@ interface HTMLDialogElement : HTMLElement { are:

      +
    1. If this does not have an open + attribute, then return.

    2. +
    3. If returnValue is not given, then set it to null.

    4. Request to close the dialog with this and From fb01762f6422c36cf1e9069b54deda47a471204d Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Tue, 12 Nov 2024 16:08:50 -0800 Subject: [PATCH 08/17] Adjust algorithm to match impl and tests --- source | 61 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/source b/source index 295cc002ede..f5c5acb898c 100644 --- a/source +++ b/source @@ -62286,39 +62286,40 @@ interface HTMLDialogElement : HTMLElement {

    5. Let target be event's target.

    6. +
    7. Assert: event is a PointerEvent.

    8. +
    9. Let document be target's node document.

    10. If document's light dismissible dialog list is empty, then return.

    11. -
    12. If event is a PointerEvent and event's type is "pointerdown", - then: set document's dialog pointerdown target to the result of running - topmost clicked dialog given target.

    13. +
    14. Let ancestor be the result of running topmost clicked dialog + given target and event.

    15. + +
    16. If event's type is + "pointerdown", then: set document's + dialog pointerdown target to ancestor.

    17. -

      If event is a PointerEvent and event's type is "pointerup", - then:

      +

      If event's type is + "pointerup", then:

        -
      1. Let clickedDialog be the result of running topmost clicked - dialog given target.

      2. - -
      3. Let topDialog be document's light dismissible dialog - list's last element.

      4. - -
      5. Let sameTarget be true if clickedDialog is dialog pointerdown +

      6. Let sameTarget be true if ancestor is dialog pointerdown target.

      7. -
      8. Let clickedTopDialog be true if clickedDialog is - topDialog,

      9. -
      10. Set document's dialog pointerdown target to null.

      11. -
      12. If clickedTopDialog is true or sameTarget is false, then return.

      13. +
      14. If sameTarget is false, then return.

      15. -
      16. Perform request to close the dialog given topDialog.

      17. +
      18. For each dialog in document's light dismissible + dialog list, in reverse order, run these substeps:

        + +
          +
        1. If dialog is ancestor, continue.

        2. + +
        3. Perform request to close the dialog given dialog.

        4. +
    @@ -62326,9 +62327,9 @@ interface HTMLDialogElement : HTMLElement {

    To run light dismiss activities, given an Event event:

      -
    1. Run Light dismiss open dialogs with event.

    2. -
    3. Run Light dismiss open popovers with event.

    4. + +
    5. Run Light dismiss open dialogs with event.

    Run light dismiss activities will be called by the HTMLDialogElement : HTMLElement {

  • Close the dialog given dialog and returnValue.

  • -

    To find the topmost clicked dialog, given a Node node:

    +

    To find the topmost clicked dialog, given a Node node and + a PointerEvent event:

      +
    1. If node is an HTML dialog element, + node has an open attribute, node's + is modal flag is true, and event's clientX and + clientY are outside the bounds of node, then return null. + +

      The check for clientX and clientY + is because a pointer event that hits the ::backdrop pseudo element of a + dialog will result in event having a target of the dialog element itself.

      +
    2. Let clickedDialog be the result of running nearest inclusive open dialog given node.

    3. @@ -62386,10 +62397,8 @@ interface HTMLDialogElement : HTMLElement {
      1. If currentNode is an HTML dialog - element, currentNode's closedby - attribute is in the any state and - currentNode has an open attribute, then - return currentNode.

      2. + element and currentNode has an open + attribute, then return currentNode.

      3. Set currentNode to currentNode's parent in the flat tree.

      4. From 4f205bd5ea768ba998c6291a4e5eb6410efae6e4 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Wed, 13 Nov 2024 10:19:52 -0800 Subject: [PATCH 09/17] Address comments --- source | 51 +++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/source b/source index f5c5acb898c..0751837bacc 100644 --- a/source +++ b/source @@ -61700,26 +61700,27 @@ interface HTMLDialogElement : HTMLElement { Brief description - any - any + any + Any Close requests (e.g. user hitting ESC) or clicks outside close the dialog. - closerequest - close request + closerequest + Close Request Close requests (e.g. user hitting ESC) close the dialog. - none - none + none + None No user actions automatically close the dialog.

        The closedby attribute's invalid value default and missing value - default are both the auto state. The auto state matches close request state when the element is modal; - otherwise the none state.

        + default
        are both the Auto state.

        + +

        The Auto state matches Close Request state when the element is modal; + otherwise the None state.

        @@ -61878,8 +61879,8 @@ interface HTMLDialogElement : HTMLElement {
      5. enabled being true if this's closedby attribute state is Any or Close Request; otherwise false.

      6. + data-x="attr-dialog-closedby-any-state">Any or Close Request; otherwise false.

        @@ -61976,9 +61977,9 @@ interface HTMLDialogElement : HTMLElement {
      7. enabled being true if this's closedby attribute is in the Any, Close Request, or Auto state; otherwise false.

      8. + data-x="attr-dialog-closedby-any-state">Any, Close Request, or Auto state; otherwise false.

        @@ -62234,9 +62235,10 @@ interface HTMLDialogElement : HTMLElement {
      9. Assert: element's close watcher is not null.

      10. -
      11. If value is in the Any state, - or Close Request state, - or Auto state and element's is +

      12. If the closedby attribute is in the + Any state, + Close Request state, + or Auto state and element's is modal flag is true, then let enabled to true; otherwise false.

      13. Set element's close watcher's HTMLDialogElement : HTMLElement {

        Dialog light dismiss

        -

        "Light dismiss" means that clicking outside of a dialog whose "Light dismiss" means that clicking outside of a dialog element whose closedby attribute is in the any state will close the dialog. This is in addition to - how such dialogs respond to close requests.

        + data-x="attr-dialog-closedby-any-state">Any state will close the dialog element. This + is in addition to how such dialogs respond to close requests.

        To light dismiss open dialogs, given an Event event:

        @@ -62376,9 +62378,10 @@ interface HTMLDialogElement : HTMLElement {
      14. Let dialogs be « ».

      15. For each Element element in - document: if element is a dialog element, - element's closedby attribute is in the any state, and element has the document's descendants, in shadow-including tree order: if element + is a dialog element, element's + closedby attribute is in the Any state, and element has the open attribute, then append element to dialogs.

      16. From 38bdafe78eac6e5ee7a0a6e5992ac1f3b0355b44 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Wed, 13 Nov 2024 10:25:27 -0800 Subject: [PATCH 10/17] Update attribute index --- source | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source b/source index 0751837bacc..b144402d441 100644 --- a/source +++ b/source @@ -142365,6 +142365,13 @@ interface External { HTML elements Classes to which the element belongs Set of space-separated tokens + + closedby + dialog + Which user actions will close the dialog + "any"; + "closerequest"; + "none"; color link From 873e451cb9e5fea07daf1a0f12720c41b9df7511 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 14 Nov 2024 15:20:19 -0800 Subject: [PATCH 11/17] Adjustments from dbaron --- source | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/source b/source index b144402d441..c58dbffeec8 100644 --- a/source +++ b/source @@ -62314,12 +62314,20 @@ interface HTMLDialogElement : HTMLElement {
      17. If sameTarget is false, then return.

      18. -
      19. For each dialog in document's light dismissible - dialog list, in reverse order, run these substeps:

        +
      20. Let dialogList be document's light dismissible + dialog list, in reverse order.

      21. + +

        We make a copy of the light dismissible dialog list because that list + will change as dialogs are closed.

        + +
      22. For each dialog in dialogList, run these substeps:

        1. If dialog is ancestor, continue.

        2. +
        3. If dialog's closedby attribute + is not in the Any state, continue.

        4. +
        5. Perform request to close the dialog given dialog.

      @@ -62379,9 +62387,7 @@ interface HTMLDialogElement : HTMLElement {
    4. For each Element element in document's descendants, in shadow-including tree order: if element - is a dialog element, element's - closedby attribute is in the Any state, and element has the dialog element and element has the open attribute, then append element to dialogs.

    5. From e7fbbec792c75501ed6ecde6f9b03a5cc4291c2d Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 15 Nov 2024 12:34:50 -0800 Subject: [PATCH 12/17] Fix up the return value --- source | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/source b/source index c58dbffeec8..ae9a7f42797 100644 --- a/source +++ b/source @@ -61875,7 +61875,8 @@ interface HTMLDialogElement : HTMLElement { data-x="dom-Event-cancelable">cancelable
      attribute initialized to true.

    6. closeAction being to close the - dialog given this and null.

    7. + dialog given this and this's requestClose + returnValue.

    8. enabled being true if this's closedby attribute state is HTMLDialogElement : HTMLElement {

    9. If this does not have an open attribute, then return.

    10. +
    11. If this's is modal is false, throw an + "InvalidStateError" DOMException, then return.

    12. + +
    13. Assert: this's close watcher + is not null.

    14. +
    15. If returnValue is not given, then set it to null.

    16. -
    17. Request to close the dialog with this and +

    18. Set this's requestClose returnValue to returnValue.

    19. + +
    20. Request to close dialog's + close watcher.

    When a dialog element subject is to be close watcher, which is a close watcher or null, initially null.

    +

    Each dialog element has a requestClose returnValue, which is a string, + initially null.

    +

    Each dialog element has an is modal flag. When a dialog element is created, this flag must be set to false.

    @@ -62328,7 +62341,9 @@ interface HTMLDialogElement : HTMLElement {
  • If dialog's closedby attribute is not in the Any state, continue.

  • -
  • Perform request to close the dialog given dialog.

  • +
  • If dialog's close watcher is not + null, Request to close dialog's + close watcher.

  • @@ -62346,20 +62361,6 @@ interface HTMLDialogElement : HTMLElement { href="https://github.com/w3c/pointerevents/pull/460">Pointer Events spec
    when the user clicks or touches anywhere on the page.

    -

    To request to close the dialog, given a dialog element - dialog and a string returnValue:

    - -
      -
    1. Let notCanceled be the result of firing an event named cancel at - dialog, with the cancelable attribute - initialized to true.

    2. - -
    3. If notCanceled is false, return.

    4. - -
    5. Close the dialog given dialog and returnValue.

    6. -
    -

    To find the topmost clicked dialog, given a Node node and a PointerEvent event:

    From 8b019a41234e928930f7b521ce68c6fd204532ed Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 15 Nov 2024 14:40:58 -0800 Subject: [PATCH 13/17] Fix up closewatcher --- source | 116 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/source b/source index ae9a7f42797..83eaf37466a 100644 --- a/source +++ b/source @@ -61863,27 +61863,7 @@ interface HTMLDialogElement : HTMLElement {
  • Add an open attribute to this, whose value is the empty string.

  • -
  • -

    Set this's close watcher to the - result of establishing a close watcher given - this's relevant global object, with:

    - -
      -
    • cancelAction being to return the - result of firing an event named cancel at this, with the cancelable attribute initialized to true.

    • - -
    • closeAction being to close the - dialog given this and this's requestClose - returnValue.

    • - -
    • enabled being true if this's - closedby attribute state is Any or Close Request; otherwise false.

    • -
    -
  • +
  • Set the dialog closewatcher with this.

  • Set this's previously focused element to the focused element.

  • @@ -61910,12 +61890,12 @@ interface HTMLDialogElement : HTMLElement {
  • If this has an open attribute, then throw an "InvalidStateError" DOMException.

  • -
  • If this's node document is not fully active, then - throw an "InvalidStateError" DOMException.

  • -
  • If this is not connected, then throw an "InvalidStateError" DOMException.

  • +
  • If this's node document is not fully active, then + throw an "InvalidStateError" DOMException.

  • +
  • If this is in the popover showing state, then throw an "InvalidStateError" DOMException.

  • @@ -61960,29 +61940,7 @@ interface HTMLDialogElement : HTMLElement { already contain this, then add an element to the top layer given this.

    -
  • -

    Set this's close watcher to the - result of establishing a close watcher given - this's relevant global object, with:

    - -
      -
    • cancelAction given - canPreventClose being to return the result of firing an event named cancel at this, with the cancelable attribute initialized to - canPreventClose.

    • - -
    • closeAction being to close the - dialog given this and null.

    • - -
    • enabled being true if this's - closedby attribute is in the Any, Close Request, or Auto state; otherwise false.

    • -
    -
  • +
  • Set the dialog closewatcher with this.

  • Set this's previously focused element to the focused element.

  • @@ -61999,6 +61957,52 @@ interface HTMLDialogElement : HTMLElement {
  • Run the dialog focusing steps given this.

  • +

    To set the dialog closewatcher, given a dialog + element dialog: set dialog's close + watcher to the result of establishing a close + watcher given dialog's relevant global object, with:

    + +
      +
    • cancelAction given + canPreventClose being to return the result of firing + an event named cancel at dialog, with the + cancelable attribute initialized to + canPreventClose.

    • + +
    • closeAction being to close the + dialog given dialog and dialog's requestClose + returnValue.

    • + +
    • enabled being true if dialog's + closedby state is not None; + otherwise false.

    • +
    + +

    To retrieve a dialog's closedby state, given a dialog + dialog, perform the following steps: + +

      +
    1. If dialog's closedby attribute + is an ASCII case-insensitive match for + "any", return + Any.

    2. + +
    3. If dialog's closedby attribute + is an ASCII case-insensitive match for + "closerequest", return + Close Request.

    4. + +
    5. If dialog's closedby attribute + is an ASCII case-insensitive match for + "none", return + None.

    6. + +
    7. If dialog's is modal is true, return Close Request.

    8. + +
    9. Return None.

    10. +
    +

    The dialog focusing steps, given a dialog element subject, are as follows:

    @@ -62079,7 +62083,8 @@ interface HTMLDialogElement : HTMLElement {
  • If this does not have an open attribute, then return.

  • -
  • If this's is modal is false, throw an +

  • If this's closedby state is + None, throw an "InvalidStateError" DOMException, then return.

  • Assert: this's close watcher @@ -62242,17 +62247,12 @@ interface HTMLDialogElement : HTMLElement {

  • If element has no open attribute, then return.

  • -
  • If oldValue and value are in the same state, then return.

  • -
  • Assert: element's close watcher is not null.

  • -
  • If the closedby attribute is in the - Any state, - Close Request state, - or Auto state and element's is - modal flag is true, then let enabled to true; otherwise false.

  • +
  • If element's closedby state is not + None state then let enabled + to true; otherwise false.

  • Set element's close watcher's enabled boolean to enabled.

  • @@ -62338,8 +62338,8 @@ interface HTMLDialogElement : HTMLElement {
    1. If dialog is ancestor, continue.

    2. -
    3. If dialog's closedby attribute - is not in the Any state, continue.

    4. +
    5. If dialog's closedby state is not + Any, continue.

    6. If dialog's close watcher is not null, Request to close dialog's From b57968e81a76395a5d8e0e6f96862d85dae9be31 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 15 Nov 2024 14:52:12 -0800 Subject: [PATCH 14/17] Fix up ol/li/p --- source | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/source b/source index 83eaf37466a..48c04b97269 100644 --- a/source +++ b/source @@ -62327,24 +62327,28 @@ interface HTMLDialogElement : HTMLElement {

    7. If sameTarget is false, then return.

    8. -
    9. Let dialogList be document's light dismissible - dialog list, in reverse order.

    10. +
    11. +

      Let dialogList be document's light dismissible + dialog list, in reverse order.

      -

      We make a copy of the light dismissible dialog list because that list - will change as dialogs are closed.

      +

      We make a copy of the light dismissible dialog list because that list + will change as dialogs are closed.

      +
    12. -
    13. For each dialog in dialogList, run these substeps:

    14. +
    15. +

      For each dialog in dialogList, run these substeps:

      -
        -
      1. If dialog is ancestor, continue.

      2. +
          +
        1. If dialog is ancestor, continue.

        2. -
        3. If dialog's closedby state is not - Any, continue.

        4. +
        5. If dialog's closedby state is not + Any, continue.

        6. -
        7. If dialog's close watcher is not - null, Request to close dialog's - close watcher.

        8. -
        +
      3. If dialog's close watcher is not + null, Request to close dialog's + close watcher.

      4. +
      +
    From ea474afd7847703b1a5b65eae3e3c4b6d1c4a936 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 15 Nov 2024 14:57:38 -0800 Subject: [PATCH 15/17] Some cleanup --- source | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/source b/source index 48c04b97269..431ca3f4882 100644 --- a/source +++ b/source @@ -61958,25 +61958,31 @@ interface HTMLDialogElement : HTMLElement {

    To set the dialog closewatcher, given a dialog - element dialog: set dialog's close - watcher to the result of establishing a close - watcher given dialog's relevant global object, with:

    + element dialog, perform the following steps:

    -
      -
    • cancelAction given - canPreventClose being to return the result of firing - an event named cancel at dialog, with the - cancelable attribute initialized to - canPreventClose.

    • +
        +
      1. +

        Set dialog's close watcher to the + result of establishing a close watcher given + dialog's relevant global object, with:

        -
      2. closeAction being to close the - dialog given dialog and dialog's requestClose - returnValue.

      3. +
          +
        • cancelAction given + canPreventClose being to return the result of firing + an event named cancel at dialog, with the + cancelable attribute initialized to + canPreventClose.

        • -
        • enabled being true if dialog's - closedby state is not None; - otherwise false.

        • -
        +
      4. closeAction being to close the + dialog given dialog and dialog's requestClose + returnValue.

      5. + +
      6. enabled being true if dialog's + closedby state is not None; + otherwise false.

      7. +
    + +

    To retrieve a dialog's closedby state, given a dialog dialog, perform the following steps: @@ -62344,8 +62350,10 @@ interface HTMLDialogElement : HTMLElement {

  • If dialog's closedby state is not Any, continue.

  • -
  • If dialog's close watcher is not - null, Request to close dialog's +

  • Assert dialog's close watcher is not + null.

  • + +
  • Request to close dialog's close watcher.

  • From db5619137870eeff4114a7875555976593d33e1e Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 15 Nov 2024 15:12:34 -0800 Subject: [PATCH 16/17] Fix "empty" xref --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 431ca3f4882..1e9d108f5f8 100644 --- a/source +++ b/source @@ -62311,8 +62311,8 @@ interface HTMLDialogElement : HTMLElement {
  • Let document be target's node document.

  • -
  • If document's light dismissible dialog list is empty, then - return.

  • +
  • If document's light dismissible dialog list is + empty, then return.

  • Let ancestor be the result of running topmost clicked dialog given target and event.

  • From 82a4561b57573945e12b020195e41be3d3ea017c Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 21 Nov 2024 15:26:49 -0800 Subject: [PATCH 17/17] Address domenic@ comments --- source | 240 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 119 insertions(+), 121 deletions(-) diff --git a/source b/source index 1e9d108f5f8..f0f51fbfdfc 100644 --- a/source +++ b/source @@ -4055,6 +4055,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The scroll event
  • The scrollend event
  • set up browsing context features
  • +
  • The clientX and clientY extension attributes of the MouseEvent interface
  • The following features and terms are defined in CSS Syntax: @@ -61594,8 +61595,8 @@ interface HTMLDialogElement : HTMLElement { [CEReactions] attribute DOMString closedBy; [CEReactions] undefined show(); [CEReactions] undefined showModal(); - [CEReactions] undefined close(optional DOMString returnValue); - [CEReactions] undefined requestClose(optional DOMString returnValue); + [CEReactions] undefined close(optional DOMString returnValue = null); + [CEReactions] undefined requestClose(optional DOMString returnValue = null); };

    Uses HTMLDialogElement.
    @@ -61702,12 +61703,11 @@ interface HTMLDialogElement : HTMLElement { any Any - Close requests (e.g. user hitting ESC) or clicks - outside close the dialog. + Close requests or clicks outside close the dialog. closerequest Close Request - Close requests (e.g. user hitting ESC) close the dialog. + Close requests close the dialog. none None @@ -61718,9 +61718,10 @@ interface HTMLDialogElement : HTMLElement { default">invalid value default and missing value default are both the Auto state.

    -

    The Auto state matches Close Request state when the element is modal; - otherwise the None state.

    +

    The Auto state behaves as + Close Request state when the + dialog was shown using its showModal() + method; otherwise the None state.

    @@ -61777,7 +61778,21 @@ interface HTMLDialogElement : HTMLElement {
    dialog.requestClose([ result ])
    -

    Requests the closure of the dialog element.

    +

    Acts as if a close request was sent targeting + dialog, by first firing a cancel event, and if + that event is not canceled with preventDefault(), + proceeding to close the dialog in the same way as the close() method (including firing a close event).

    + +

    This is a helper utility that can be used to consolidate cancelation and closing logic into + the cancel and close event + handlers, by having all non-close request closing + affordances call this method.

    + +

    Note that this method ignores the closedby + attribute: that is, even if closedby is set to + "none", the same behavior will apply.

    The argument, if provided, provides a return value.

    @@ -61863,7 +61878,7 @@ interface HTMLDialogElement : HTMLElement {
  • Add an open attribute to this, whose value is the empty string.

  • -
  • Set the dialog closewatcher with this.

  • +
  • Set the dialog close watcher with this.

  • Set this's previously focused element to the focused element.

  • @@ -61940,7 +61955,7 @@ interface HTMLDialogElement : HTMLElement { already contain this, then add an element to the top layer given this.

    -
  • Set the dialog closewatcher with this.

  • +
  • Set the dialog close watcher with this.

  • Set this's previously focused element to the focused element.

  • @@ -61957,8 +61972,8 @@ interface HTMLDialogElement : HTMLElement {
  • Run the dialog focusing steps given this.

  • -

    To set the dialog closewatcher, given a dialog - element dialog, perform the following steps:

    +

    To set the dialog close watcher, given a dialog + element dialog:

    1. @@ -61974,39 +61989,34 @@ interface HTMLDialogElement : HTMLElement { canPreventClose.

    2. closeAction being to close the - dialog given dialog and dialog's requestClose - returnValue.

    3. + dialog given dialog and dialog's request close return + value.

      -
    4. enabled being true if dialog's - closedby state is not None; - otherwise false.

    5. +
    6. getEnabledState being to return + true if dialog's computed closed-by state is not None; otherwise false.

    -

    To retrieve a dialog's closedby state, given a dialog - dialog, perform the following steps: +

    To retrieve a dialog's computed closed-by state, given a dialog + dialog:

      -
    1. If dialog's closedby attribute - is an ASCII case-insensitive match for - "any", return - Any.

    2. - -
    3. If dialog's closedby attribute - is an ASCII case-insensitive match for - "closerequest", return - Close Request.

    4. +
    5. +

      If the state of dialog's closedby + attribute is Auto, then:

      -
    6. If dialog's closedby attribute - is an ASCII case-insensitive match for - "none", return - None.

    7. +
        +
      1. If dialog's is modal is true, then return Close Request.

      2. -
      3. If dialog's is modal is true, return Close Request.

      4. +
      5. Return None.

      6. +
      + -
    8. Return None.

    9. +
    10. Return the state of dialog's closedby attribute.

    The dialog focusing steps, given a dialog element subject, @@ -62076,8 +62086,6 @@ interface HTMLDialogElement : HTMLElement { data-x="dom-dialog-close">close(returnValue) method steps are:

      -
    1. If returnValue is not given, then set it to null.

    2. -
    3. Close the dialog this with returnValue.

    @@ -62089,16 +62097,14 @@ interface HTMLDialogElement : HTMLElement {
  • If this does not have an open attribute, then return.

  • -
  • If this's closedby state is - None, throw an - "InvalidStateError" DOMException, then return.

  • +
  • If this's computed closed-by state is + None, then throw an + "InvalidStateError" DOMException.

  • -
  • Assert: this's close watcher +

  • Assert: this's close watcher is not null.

  • -
  • If returnValue is not given, then set it to null.

  • - -
  • Set this's requestClose returnValue to +

  • Set this's request close return value to returnValue.

  • Request to close dialog's @@ -62138,6 +62144,8 @@ interface HTMLDialogElement : HTMLElement {

  • If result is not null, then set the returnValue attribute to result.

  • +
  • Set the request close return value to null.

  • +
  • If subject's previously focused element is not null, then:

    @@ -62225,8 +62233,8 @@ interface HTMLDialogElement : HTMLElement {

    Each dialog element has a close watcher, which is a close watcher or null, initially null.

    -

    Each dialog element has a requestClose returnValue, which is a string, - initially null.

    +

    Each dialog element has a request close return value, which is a + string, initially null.

    Each dialog element has an is modal flag. When a dialog element is created, this flag must be set to false.

    @@ -62250,18 +62258,8 @@ interface HTMLDialogElement : HTMLElement {
  • If localName is not closedby, then return.

  • -
  • If element has no open attribute, then +

  • If element has no open attribute, then return.

  • - -
  • Assert: element's close - watcher is not null.

  • - -
  • If element's closedby state is not - None state then let enabled - to true; otherwise false.

  • - -
  • Set element's close watcher's enabled boolean to enabled.


  • @@ -62304,11 +62302,11 @@ interface HTMLDialogElement : HTMLElement {
  • Assert: event's isTrusted attribute is true.

  • +
  • Assert: event is a PointerEvent.

  • +
  • Let target be event's target.

  • -
  • Assert: event is a PointerEvent.

  • -
  • Let document be target's node document.

  • If document's light dismissible dialog list is @@ -62318,7 +62316,7 @@ interface HTMLDialogElement : HTMLElement { given target and event.

  • If event's type is - "pointerdown", then: set document's + "pointerdown", then set document's dialog pointerdown target to ancestor.

  • @@ -62326,31 +62324,32 @@ interface HTMLDialogElement : HTMLElement { "pointerup", then:

      -
    1. Let sameTarget be true if ancestor is dialog pointerdown - target.

    2. +
    3. Let sameTarget be true if ancestor is document's + dialog pointerdown target.

    4. Set document's dialog pointerdown target to null.

    5. If sameTarget is false, then return.

    6. -

      Let dialogList be document's light dismissible - dialog list, in reverse order.

      +

      Let dialogList be a clone of + document's light dismissible dialog list, in reverse order.

      We make a copy of the light dismissible dialog list because that list will change as dialogs are closed.

    7. -

      For each dialog in dialogList, run these substeps:

      +

      For each dialog of dialogList:

        -
      1. If dialog is ancestor, continue.

      2. +
      3. If dialog is ancestor, then continue.

      4. -
      5. If dialog's closedby state is not - Any, continue.

      6. +
      7. If dialog's computed closed-by state is not + Any, then + continue.

      8. -
      9. Assert dialog's close watcher is not +

      10. Assert dialog's close watcher is not null.

      11. Request to close dialog's @@ -62364,9 +62363,9 @@ interface HTMLDialogElement : HTMLElement {

        To run light dismiss activities, given an Event event:

          -
        1. Run Light dismiss open popovers with event.

        2. +
        3. Run light dismiss open popovers with event.

        4. -
        5. Run Light dismiss open dialogs with event.

        6. +
        7. Run light dismiss open dialogs with event.

        Run light dismiss activities will be called by the HTMLDialogElement : HTMLElement { a PointerEvent event:

          -
        1. If node is an HTML dialog element, - node has an open attribute, node's - is modal flag is true, and event's clientX and - clientY are outside the bounds of node, then return null. - -

          The check for clientX and clientY - is because a pointer event that hits the ::backdrop pseudo element of a - dialog will result in event having a target of the dialog element itself.

          - -
        2. Let clickedDialog be the result of running nearest inclusive open - dialog given node.

        3. - -
        4. Return clickedDialog.

        5. -
        - -

        To get the light dismissible dialog list for a - Document document:

        - -
          -
        1. Let dialogs be « ».

        2. +
        3. If node is a dialog element, node has an open attribute, node's is modal flag is + true, and event's clientX and + clientY are outside the bounds of node, then + return null. -

        4. For each Element element in - document's descendants, in shadow-including tree order: if element - is a dialog element and element has the open attribute, then append - element to dialogs.

        5. - -
        6. Return dialogs.

        7. -
        +

        The check for clientX and clientY is because a pointer event that hits the ::backdrop pseudo element of a dialog will result in event having a + target of the dialog element itself.

        -

        To find the nearest inclusive open dialog given a Node - node, perform the following steps. They return an HTML dialog element or null.

        - -
        1. Let currentNode be node.

        2. While currentNode is not null:

            -
          1. If currentNode is an HTML dialog - element and currentNode has an open - attribute, then return currentNode.

          2. +
          3. If currentNode is a dialog element and currentNode + has an open attribute, then return + currentNode.

          4. Set currentNode to currentNode's parent in the flat tree.

          5. @@ -62430,6 +62405,21 @@ interface HTMLDialogElement : HTMLElement {
          6. Return null.

          +

          To get the light dismissible dialog list for a Document + document:

          + +
            +
          1. Let dialogs be « ».

          2. + +
          3. For each Element element in + document's shadow-including + descendants, in shadow-including tree order: if element is a + dialog element and element has the open attribute, then append + element to dialogs.

          4. + +
          5. Return dialogs.

          6. +

          Scripting

          @@ -83118,7 +83108,9 @@ body { display:none }
        3. An is running cancel action boolean.

        4. -
        5. An enabled boolean.

        6. +
        7. A get enabled state, an algorithm + accepting no arguments and returning a boolean. This algorithm can never throw an + exception.

        8. A close watcher closeWatcher is @@ -83131,8 +83123,8 @@ body { display:none }

          To establish a close watcher given a Window window, a list of steps cancelAction, a list of steps closeAction, - and an optional boolean enabled - (default true):

          + and an algorithm that returns a boolean getEnabledState:

          1. Assert: window's is running cancel action

            false
            -
            enabled
            -
            enabled
            +
            get enabled state
            +
            getEnabledState
          2. @@ -83196,8 +83188,9 @@ body { display:none }
          3. If closeWatcher is not active, then return true.

          4. -
          5. If closeWatcher's enabled is false, - then return true.

          6. +
          7. If the result of running closeWatcher's get enabled state is false, then return + true.

          8. If closeWatcher's is running cancel action is true, then return true.

          9. @@ -83253,8 +83246,8 @@ body { display:none }
          10. If closeWatcher is not active, then return.

          11. -
          12. If closeWatcher's enabled is false, - then return true.

          13. +
          14. If the result of running closeWatcher's get enabled state is false, then return.

          15. If closeWatcher's window's associated Document is not fully @@ -83303,8 +83296,9 @@ body { display:none } in reverse order:

              -
            1. If closeWatcher's enabled is - true, set processedACloseWatcher to true.

            2. +
            3. If the result of running closeWatcher's get enabled state is true, set + processedACloseWatcher to true.

            4. Let shouldProceed be the result of requesting to close @@ -84818,8 +84812,9 @@ dictionary DragEventInit : MouseEventInit {

              If there is no relevant pointing device, then initialize event's screenX, screenY, clientX, clientY, and button attributes to 0.

              + data-x="">screenX, screenY, clientX, clientY, + and button attributes to 0.

            5. Dispatch event at the specified @@ -85954,6 +85949,9 @@ dictionary DragEventInit : MouseEventInit {

            6. closeAction being to hide a popover given element, true, true, and false.

            7. + +
            8. getEnabledState being to return + true.