From 830339db00a44599fdbdae5e741332dd01d6d3b7 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 19 Feb 2025 16:15:57 +0000 Subject: [PATCH 1/6] Add request-close command for dialogs This new command maps to the dialog's requestClose function. --- source | 70 +++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/source b/source index 0ff221da5db..c2fe2518750 100644 --- a/source +++ b/source @@ -53560,6 +53560,11 @@ interface HTMLButtonElement : HTMLElement { data-x="attr-button-command-close">close Close Closes the targeted dialog element. + + request-close + Request Close + Requests to close the targeted dialog element. show-modal @@ -62226,25 +62231,10 @@ interface HTMLDialogElement : HTMLElement { are:

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

  2. - -
  3. Assert: this's close - watcher is not null.

  4. - -
  5. Set dialog's enable close watcher for requestClose() to true.

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

  8. -
  9. Set this's request close return value to - returnValue.

  10. - -
  11. Request to close dialog's - close watcher with false.

  12. - -
  13. Set dialog's enable close watcher for requestClose() to false.

  14. +
  15. Request to close the dialog this + with returnValue.

@@ -62481,9 +62471,9 @@ interface HTMLDialogElement : HTMLElement {
  1. If command is in the Close state or in the Show Modal state, then - return true.

  2. + data-x="attr-button-command-close-state">Close state, Request Close state or the Show Modal state, then return true.

  3. Return false.

@@ -62508,6 +62498,20 @@ interface HTMLDialogElement : HTMLElement { +
  • +

    If command is in the Close state and element has + an open attribute:

    + +
      +
    1. Let value be invoker's value.

    2. + +
    3. Request to close the dialog + element with value.

    4. +
    +
  • +
  • If command is the Show Modal state and element does not have an open attribute, then @@ -62610,6 +62614,31 @@ interface HTMLDialogElement : HTMLElement {

  • +

    To request to close dialog element + subject, given null or a string returnValue:

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

    2. + +
    3. Assert: this's close + watcher is not null.

    4. + +
    5. Set dialog's enable close watcher for requestClose() to true.

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

    8. + +
    9. Set this's request close return value to + returnValue.

    10. + +
    11. Request to close dialog's + close watcher with false.

    12. + +
    13. Set dialog's enable close watcher for requestClose() to false.

    14. +
    +

    To queue a dialog toggle event task given a dialog element @@ -143435,6 +143464,7 @@ interface External { "show-popover"; "hide-popover"; "close"; + "request-close"; "show-modal"; a custom command keyword From 0b2bccb8ce4e7a543065c5549f4f4678ac8db9a1 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 25 Feb 2025 14:09:08 +0000 Subject: [PATCH 2/6] Address comments - Rename enable close watcher for requestClose() - Add note to enable close watcher for request close --- source | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/source b/source index c2fe2518750..579b200f1e3 100644 --- a/source +++ b/source @@ -62310,8 +62310,14 @@ interface HTMLDialogElement : HTMLElement {

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

    -

    Each dialog element has an enable close watcher for requestClose() boolean, initially false.

    +

    Each dialog element has an enable close watcher for request close + boolean, initially false.

    + +

    Dialog's enable close watcher for request close is used + to force enable the dialog's close watcher while requesting to close it. A dialog whose computed + closed-by state is the None state + would otherwise have a disabled close watcher.

    Each dialog element has an is modal boolean, initially false.

    @@ -62458,9 +62464,8 @@ interface HTMLDialogElement : HTMLElement { value.

  • getEnabledState being to return - true if dialog's enable close watcher for requestClose() is true or dialog's - computed closed-by state is not dialog's enable close watcher for request close is true or + dialog's computed closed-by state is not None; otherwise false.

  • @@ -62472,7 +62477,7 @@ interface HTMLDialogElement : HTMLElement {
    1. If command is in the Close state, Request Close state or the Request Close state, or the Show Modal state, then return true.

    2. Return false.

    3. @@ -62500,8 +62505,8 @@ interface HTMLDialogElement : HTMLElement {
    4. If command is in the Close state and element has - an open attribute:

      + data-x="attr-button-command-request-close-state">Request Close state and + element has an open attribute:

      1. Let value be invoker's HTMLDialogElement : HTMLElement {

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

      3. -
      4. Set dialog's enable close watcher for requestClose() to true.

      5. +
      6. Set dialog's enable close watcher for request close to + true.

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

      8. @@ -62635,8 +62640,8 @@ interface HTMLDialogElement : HTMLElement {
      9. Request to close dialog's close watcher with false.

      10. -
      11. Set dialog's enable close watcher for requestClose() to false.

      12. +
      13. Set dialog's enable close watcher for request close to + false.

      From 990132ef482e6bd617033bbc9c0c1b87850d154e Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 26 Feb 2025 16:22:19 +0000 Subject: [PATCH 3/6] lowercase dialog --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 579b200f1e3..6d4f963c5f6 100644 --- a/source +++ b/source @@ -62313,7 +62313,7 @@ interface HTMLDialogElement : HTMLElement {

      Each dialog element has an enable close watcher for request close boolean, initially false.

      -

      Dialog's enable close watcher for request close is used +

      dialog's enable close watcher for request close is used to force enable the dialog's close watcher while requesting to close it. A dialog whose computed closed-by state is the None state From 26c9782a086a8201dbe545cfa38a51ad82a16a07 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Mon, 3 Mar 2025 11:30:53 +0000 Subject: [PATCH 4/6] Address comments --- source | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source b/source index 6d4f963c5f6..74217dfedf2 100644 --- a/source +++ b/source @@ -62471,8 +62471,8 @@ interface HTMLDialogElement : HTMLElement {

    -

    The is valid invoker command steps for dialog elements, given - a command attribute command, are:

    +

    The is valid invoker command steps for dialog elements, given a command attribute command, are:

    1. If command is in the HTMLDialogElement : HTMLElement {

    2. Set dialog's enable close watcher for request close to true.

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

    5. -
    6. Set this's request close return value to returnValue.

    7. From 627ea9990784005048d5a06ad5a6f9e227c3677c Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Mon, 3 Mar 2025 12:24:02 +0000 Subject: [PATCH 5/6] Update request-close and close command handling of button value attribute --- source | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source b/source index 74217dfedf2..938f71f937e 100644 --- a/source +++ b/source @@ -62496,8 +62496,10 @@ interface HTMLDialogElement : HTMLElement { state and element has an open attribute:

        -
      1. Let value be invoker's value.

      2. +
      3. Let value be null.

      4. + +
      5. If invoker has a value attribute, set + value to invoker's value.

      6. Close the dialog element with value.

      @@ -62509,8 +62511,10 @@ interface HTMLDialogElement : HTMLElement { element has an open attribute:

        -
      1. Let value be invoker's value.

      2. +
      3. Let value be null.

      4. + +
      5. If invoker has a value attribute, set + value to invoker's value.

      6. Request to close the dialog element with value.

      7. From 82c7bd0474e1ef3c7f4d3899b36c7737140af0b9 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Mon, 3 Mar 2025 13:26:15 +0000 Subject: [PATCH 6/6] Address comment --- source | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source b/source index 938f71f937e..40f8062ec4d 100644 --- a/source +++ b/source @@ -62498,8 +62498,9 @@ interface HTMLDialogElement : HTMLElement {
        1. Let value be null.

        2. -
        3. If invoker has a value attribute, set - value to invoker's value.

        4. +
        5. If invoker has a value attribute, + then set value to invoker's value.

        6. Close the dialog element with value.

        @@ -62513,8 +62514,9 @@ interface HTMLDialogElement : HTMLElement {
        1. Let value be null.

        2. -
        3. If invoker has a value attribute, set - value to invoker's value.

        4. +
        5. If invoker has a value attribute, + then set value to invoker's value.

        6. Request to close the dialog element with value.