From de8ec46cd0db848ca5b0ab34e27da1c8adeb1a1f Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Mon, 27 Jan 2025 20:28:20 +0000 Subject: [PATCH 01/32] Add attribute changed steps to dialog element When the dialogs open attribute is removed: 1. Remove dialog from the document's open dialogs list. 2. Destroy and nullify dialog's close watcher This also adds an assertion to the start of 'set the dialog close watcher' that dialog's close watcher is null. --- source | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/source b/source index 23140c3499b..2c3fd02d505 100644 --- a/source +++ b/source @@ -62461,6 +62461,38 @@ interface HTMLDialogElement : HTMLElement { removedNode's node document's open dialogs list.

+

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

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

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

  4. + +
  5. If value is null:

    + +
      +
    1. Remove element from element's + node document's open dialogs list.

    2. + +
    3. +

      If element's close watcher is not + null, then:

      + +
        +
      1. Destroy element's close watcher.

      2. + +
      3. Set element's close watcher to + null.

      4. +
      +
    4. +
    +
  6. +
+

To show a modal dialog given a dialog element subject:

    @@ -62555,6 +62587,9 @@ interface HTMLDialogElement : HTMLElement { element dialog:

      +
    1. Assert: dialog's close + watcher is null.

    2. +
    3. Set dialog's close watcher to the result of establishing a close watcher given From 9d690df33e550787d5ad09393f51a2e22f3a5a75 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Sun, 2 Feb 2025 22:33:27 +0000 Subject: [PATCH 02/32] Replace assert in set the dialog close watcher with an early return --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 2c3fd02d505..f6e6ae3308b 100644 --- a/source +++ b/source @@ -62587,8 +62587,8 @@ interface HTMLDialogElement : HTMLElement { element dialog:

        -
      1. Assert: dialog's close - watcher is null.

      2. +
      3. If dialog's close watcher is not + null, then return.

      4. Set dialog's close watcher to the From 3ed047ed0f083941d0dd2ef291485a54cfc98d88 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 12 Feb 2025 12:09:58 +0000 Subject: [PATCH 03/32] Add dialog attribute change steps when adding open attribute Address review comments --- source | 54 +++++++++++++++++++----------------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/source b/source index f6e6ae3308b..293f45bc978 100644 --- a/source +++ b/source @@ -62283,15 +62283,6 @@ interface HTMLDialogElement : HTMLElement {

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

      6. -
      7. Assert: this's node document's open - dialogs list does not contain - this.

      8. - -
      9. Add this to this's node document's open - dialogs list.

      10. - -
      11. Set the dialog close watcher with this.

      12. -
      13. Set this's previously focused element to the focused element.

      14. @@ -62471,9 +62462,13 @@ interface HTMLDialogElement : HTMLElement {
      15. If localName is not open, then return.

      16. -
      17. If value is null:

        +
      18. If value is null and oldValue is not null:

          +
        1. Assert: element's node document's open + dialogs list contains + element.

        2. +
        3. Remove element from element's node document's open dialogs list.

        4. @@ -62491,6 +62486,20 @@ interface HTMLDialogElement : HTMLElement {
      19. + +
      20. If value is not null and oldValue is null:

        + +
          +
        1. Assert: element's node document's open + dialogs list does not contain + element.

        2. + +
        3. Add element to this's node document's open + dialogs list.

        4. + +
        5. Set the dialog close watcher with element.

        6. +
        +

      To show a modal dialog given a dialog element subject:

      @@ -62536,13 +62545,6 @@ interface HTMLDialogElement : HTMLElement {
    4. Set is modal of subject to true.

    5. -
    6. Assert: subject's node document's open - dialogs list does not contain - subject.

    7. - -
    8. Add subject to subject's node document's open - dialogs list.

    9. -
    10. Let subject's node document be blocked by the modal dialog subject.

      @@ -62559,8 +62561,6 @@ interface HTMLDialogElement : HTMLElement { already contain subject, then add an element to the top layer given subject.

    11. -
    12. Set the dialog close watcher with subject.

    13. -
    14. Set subject's previously focused element to the focused element.

    15. @@ -62707,9 +62707,6 @@ interface HTMLDialogElement : HTMLElement {
    16. Set is modal of subject to false.

    17. -
    18. Remove subject from subject's - node document's open dialogs list.

    19. -
    20. If result is not null, then set the returnValue attribute to result.

    21. @@ -62735,19 +62732,6 @@ interface HTMLDialogElement : HTMLElement {
    22. Queue an element task on the user interaction task source given the subject element to fire an event named close at subject.

    23. - -
    24. -

      If subject's close watcher is not null, - then:

      - -
        -
      1. Destroy subject's close watcher.

      2. - -
      3. Set subject's close watcher to - null.

      4. -
      -
    From d947ee7744be601596f475736bd2fe992118fb72 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 12 Feb 2025 12:34:27 +0000 Subject: [PATCH 04/32] Run specfmt --- source | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source b/source index 293f45bc978..a39c69a08ba 100644 --- a/source +++ b/source @@ -62466,8 +62466,7 @@ interface HTMLDialogElement : HTMLElement {
    1. Assert: element's node document's open - dialogs list contains - element.

    2. + dialogs list contains element.

    3. Remove element from element's node document's open dialogs list.

    4. From 533bd8212d47fd20e7a35c30ee4d37a4c179659b Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 25 Feb 2025 15:47:19 +0000 Subject: [PATCH 05/32] Define dialog cleanup and setup steps and call them from the attribute changed steps --- source | 79 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/source b/source index a39c69a08ba..c100e671e02 100644 --- a/source +++ b/source @@ -62462,43 +62462,13 @@ interface HTMLDialogElement : HTMLElement {
    5. If localName is not open, then return.

    6. -
    7. If value is null and oldValue is not null:

      - -
        -
      1. Assert: element's node document's open - dialogs list contains element.

      2. - -
      3. Remove element from element's - node document's open dialogs list.

      4. - -
      5. -

        If element's close watcher is not - null, then:

        - -
          -
        1. Destroy element's close watcher.

        2. - -
        3. Set element's close watcher to - null.

        4. -
        -
      6. -
      -
    8. - -
    9. If value is not null and oldValue is null:

      - -
        -
      1. Assert: element's node document's open - dialogs list does not contain - element.

      2. - -
      3. Add element to this's node document's open - dialogs list.

      4. +
      5. If value is null, oldValue is not null, and element is + connected, then run the dialog cleanup steps given + element.

      6. -
      7. Set the dialog close watcher with element.

      8. -
      -
    10. +
    11. If value is not null, oldValue is null, and element is + connected, then run the dialog setup steps given + element.

    To show a modal dialog given a dialog element subject:

    @@ -62836,6 +62806,43 @@ interface HTMLDialogElement : HTMLElement {
  1. Set topDocument's autofocus processed flag to true.

+

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

+ +
    +
  1. Assert: subject's node document's open dialogs + list does not contain subject.

  2. + +
  3. Add subject to subject's node document's open + dialogs list.

  4. + +
  5. Set the dialog close watcher with subject.

  6. +
+ +

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

+ +
    +
  1. Assert: subject's node document's open dialogs + list contains element.

  2. + +
  3. Remove subject from subject's + node document's open dialogs list.

  4. + +
  5. +

    If subject's close watcher is not null, + then:

    + +
      +
    1. Destroy subject's close watcher.

    2. + +
    3. Set subject's close watcher to + null.

    4. +
    +
  6. +
+

Dialog light dismiss

"Light dismiss" means that clicking outside of a dialog element whose Date: Tue, 25 Feb 2025 16:03:41 +0000 Subject: [PATCH 06/32] Call dialog cleanup steps from dialog removing steps --- source | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/source b/source index c100e671e02..6705dd92c59 100644 --- a/source +++ b/source @@ -62430,15 +62430,11 @@ interface HTMLDialogElement : HTMLElement {

  1. -

    If removedNode's close watcher is not - null, then:

    +

    If removedNode has an open + attribute:

      -
    1. Destroy removedNode's close watcher.

    2. - -
    3. Set removedNode's close watcher to - null.

    4. +
    5. Run the dialog cleanup steps given removedNode.

  2. @@ -62447,9 +62443,6 @@ interface HTMLDialogElement : HTMLElement { the top layer immediately given removedNode.

  3. Set is modal of removedNode to false.

  4. - -
  5. Remove removedNode from - removedNode's node document's open dialogs list.

The following attribute change From 6e790b299c6ec3b3da60907faedaef141c7e68a7 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 25 Feb 2025 16:09:54 +0000 Subject: [PATCH 07/32] Define dialog HTML element insertion steps and call dialog setup steps --- source | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/source b/source index 6705dd92c59..253ce66e262 100644 --- a/source +++ b/source @@ -62425,13 +62425,27 @@ interface HTMLDialogElement : HTMLElement {


+ + +

The dialog HTML element insertion steps, given + insertedNode, are:

+ +
    +
  1. +

    If insertedNode has an open attribute:

    + +
      +
    1. Run the dialog setup steps given insertedNode.

    2. +
    +
  2. +
+

The dialog HTML element removing steps, given removedNode and oldParent, are:

  1. -

    If removedNode has an open - attribute:

    +

    If removedNode has an open attribute:

    1. Run the dialog cleanup steps given removedNode.

    2. From a38e217edc82de2ae55126cb338cdcbad692970e Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 25 Feb 2025 17:13:36 +0000 Subject: [PATCH 08/32] Replace early return with assert --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 253ce66e262..43e5540f98d 100644 --- a/source +++ b/source @@ -62563,8 +62563,8 @@ interface HTMLDialogElement : HTMLElement { element dialog:

        -
      1. If dialog's close watcher is not - null, then return.

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

      4. Set dialog's close watcher to the From f4fb3cf869ca559120dd7733cad8373e67a44290 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Fri, 7 Mar 2025 15:52:49 +0000 Subject: [PATCH 09/32] Revert "Replace early return with assert" This reverts commit e7096dfdffabae2076b86672e03a154a4ecee10f. --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 43e5540f98d..253ce66e262 100644 --- a/source +++ b/source @@ -62563,8 +62563,8 @@ interface HTMLDialogElement : HTMLElement { element dialog:

          -
        1. Assert: dialog's close - watcher is null.

        2. +
        3. If dialog's close watcher is not + null, then return.

        4. Set dialog's close watcher to the From 9df1928c7429d26f45efe75990654d993e935b10 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 15 Apr 2025 20:29:12 +0100 Subject: [PATCH 10/32] Add connected check to dialog insertion steps --- source | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source b/source index 253ce66e262..e3c811d630e 100644 --- a/source +++ b/source @@ -62432,7 +62432,8 @@ interface HTMLDialogElement : HTMLElement {

          1. -

            If insertedNode has an open attribute:

            +

            If insertedNode is connected and insertedNode has an open attribute:

            1. Run the dialog setup steps given insertedNode.

            2. From f7d6325ac73de89ed83428cb560520456f2c6442 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 17 Apr 2025 11:05:42 +0100 Subject: [PATCH 11/32] Attempt at fixing issues Dialog setup steps: - Move set the dialog close watcher to step 1 - Add early return when dialog is not connected as a new step 2 (before adding to dialog light dismiss list). Dialog cleanup steps: - Remove assertion - Remove disposing of close watcher. Dialog attribute change steps: - Remove connected check from steps 3 and 4. Dialog insertion steps: - Remove connected check added in previous commit. --- source | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/source b/source index e3c811d630e..45a87e07458 100644 --- a/source +++ b/source @@ -62432,8 +62432,7 @@ interface HTMLDialogElement : HTMLElement {
              1. -

                If insertedNode is connected and insertedNode has an open attribute:

                +

                If insertedNode has an open attribute:

                1. Run the dialog setup steps given insertedNode.

                2. @@ -62470,13 +62469,11 @@ interface HTMLDialogElement : HTMLElement {
                3. If localName is not open, then return.

                4. -
                5. If value is null, oldValue is not null, and element is - connected, then run the dialog cleanup steps given - element.

                6. +
                7. If value is null, and oldValue is not null, then run the + dialog cleanup steps given element.

                8. -
                9. If value is not null, oldValue is null, and element is - connected, then run the dialog setup steps given - element.

                10. +
                11. If value is not null, and oldValue is null, then run the + dialog setup steps given element.

                To show a modal dialog given a dialog element subject:

                @@ -62818,37 +62815,23 @@ interface HTMLDialogElement : HTMLElement { as follows:

                  +
                1. Set the dialog close watcher with subject.

                2. + +
                3. If subject is not connected, return.

                4. +
                5. Assert: subject's node document's open dialogs list does not contain subject.

                6. Add subject to subject's node document's open dialogs list.

                7. - -
                8. Set the dialog close watcher with subject.

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

                  -
                1. Assert: subject's node document's open dialogs - list contains element.

                2. -
                3. Remove subject from subject's node document's open dialogs list.

                4. - -
                5. -

                  If subject's close watcher is not null, - then:

                  - -
                    -
                  1. Destroy subject's close watcher.

                  2. - -
                  3. Set subject's close watcher to - null.

                  4. -
                  -

                Dialog light dismiss

                From 286a561ed926f24a73764383b4ef379541239431 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 17 Apr 2025 11:53:50 +0100 Subject: [PATCH 12/32] Add back destroy of close watcher to cleanup steps --- source | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source b/source index 45a87e07458..00daebee985 100644 --- a/source +++ b/source @@ -62832,6 +62832,20 @@ interface HTMLDialogElement : HTMLElement {
                1. Remove subject from subject's node document's open dialogs list.

                2. + +
                3. +

                  If subject's close watcher is not null, + and subject does not have an open attribute, + then:

                  + +
                    +
                  1. Destroy subject's close watcher.

                  2. + +
                  3. Set subject's close watcher to + null.

                  4. +
                  +

                Dialog light dismiss

                From 78867eef85d83358962405d1afe7db887cad3301 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 21 May 2025 10:27:36 +0100 Subject: [PATCH 13/32] remove errenous div --- source | 2 -- 1 file changed, 2 deletions(-) diff --git a/source b/source index 00daebee985..8994b577b52 100644 --- a/source +++ b/source @@ -62425,8 +62425,6 @@ interface HTMLDialogElement : HTMLElement {
                - -

                The dialog HTML element insertion steps, given insertedNode, are:

                From a72c188af45ad655aa15b5451cc3ebf333dd9246 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 21 May 2025 10:49:56 +0100 Subject: [PATCH 14/32] add many asserts --- source | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source b/source index 8994b577b52..204560a11b3 100644 --- a/source +++ b/source @@ -62283,6 +62283,9 @@ interface HTMLDialogElement : HTMLElement {
              2. Add an open attribute to this, whose value is the empty string.

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

              5. +
              6. Set this's previously focused element to the focused element.

              7. @@ -62515,6 +62518,9 @@ interface HTMLDialogElement : HTMLElement {
              8. Add an open attribute to subject, whose value is the empty string.

              9. +
              10. Assert: subject's close + watcher is not null.

              11. +
              12. Set is modal of subject to true.

              13. @@ -62562,6 +62568,10 @@ interface HTMLDialogElement : HTMLElement {
              14. If dialog's close watcher is not null, then return.

              15. +
              16. Assert: dialog has an open + attribute and dialog's active document is fully active.

                +
              17. +
              18. Set dialog's close watcher to the result of establishing a close watcher given @@ -62813,15 +62823,18 @@ interface HTMLDialogElement : HTMLElement { as follows:

                  -
                1. Set the dialog close watcher with subject.

                2. +
                3. Assert: subject has an open + attribute.

                4. -
                5. If subject is not connected, return.

                6. +
                7. Assert: subject is connected.

                8. Assert: subject's node document's open dialogs list does not contain subject.

                9. Add subject to subject's node document's open dialogs list.

                10. + +
                11. Set the dialog close watcher with subject.

                The dialog cleanup steps, given a dialog element subject, From 9bf69d79ba64bd76ec7cca39172e7adf61ba9036 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 21 May 2025 10:50:11 +0100 Subject: [PATCH 15/32] return early if dialog is not connected during setup --- source | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source b/source index 204560a11b3..b41989cd565 100644 --- a/source +++ b/source @@ -62433,7 +62433,8 @@ interface HTMLDialogElement : HTMLElement {

                1. -

                  If insertedNode has an open attribute:

                  +

                  If insertedNode has an open attribute + and is connected:

                  1. Run the dialog setup steps given insertedNode.

                  2. @@ -62473,6 +62474,8 @@ interface HTMLDialogElement : HTMLElement {
                  3. If value is null, and oldValue is not null, then run the dialog cleanup steps given element.

                  4. +
                  5. If element is not connected, return.

                  6. +
                  7. If value is not null, and oldValue is null, then run the dialog setup steps given element.

                  From 7e7905fec333b4afe0729f29e6671ab00bbad372 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 21 May 2025 10:50:34 +0100 Subject: [PATCH 16/32] return early in requestclose if dialog is not connected --- source | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source b/source index b41989cd565..a283d6c2606 100644 --- a/source +++ b/source @@ -84298,9 +84298,15 @@ dictionary CloseWatcherOptions {

                The requestClose() method steps are to request to close this's internal - close watcher with false.

                + data-x="dom-CloseWatcher-requestClose">requestClose() method steps given a + dialog element subject:

                + +
                  +
                1. If subject is connected and subject's + active document is fully active, then + request to close subject's + internal close watcher with false.

                2. +

                The close() method steps are to close this's From d4081cf9b255c8dd2133f361e7b16343c45e44fd Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 21 May 2025 10:55:03 +0100 Subject: [PATCH 17/32] specfmt --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index a283d6c2606..d9de6907a9d 100644 --- a/source +++ b/source @@ -62433,8 +62433,8 @@ interface HTMLDialogElement : HTMLElement {

                1. -

                  If insertedNode has an open attribute - and is connected:

                  +

                  If insertedNode has an open attribute and + is connected:

                  1. Run the dialog setup steps given insertedNode.

                  2. From 4a28393271d455336d56a02c7d6e08c2722d98be Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 21 May 2025 16:49:52 +0100 Subject: [PATCH 18/32] s/active document/node document --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index d9de6907a9d..68de11a83a3 100644 --- a/source +++ b/source @@ -62572,7 +62572,7 @@ interface HTMLDialogElement : HTMLElement { null, then return.

                  3. Assert: dialog has an open - attribute and dialog's active document is fully active.

                    + attribute and dialog's node document is fully active.

                  4. @@ -84303,7 +84303,7 @@ dictionary CloseWatcherOptions {
                    1. If subject is connected and subject's - active document is fully active, then + node document is fully active, then request to close subject's internal close watcher with false.

                    From cdea1932da03ae80a006c18c359aa034913b3207 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 22 May 2025 09:29:38 +0100 Subject: [PATCH 19/32] revert CloseWatcher requestClose changes, add to dialog requestclose --- source | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/source b/source index 68de11a83a3..f2bead0d824 100644 --- a/source +++ b/source @@ -62329,6 +62329,9 @@ interface HTMLDialogElement : HTMLElement {
                  5. If this does not have an open attribute, then return.

                  6. +
                  7. If this is not connected or subject's + node document is not fully active, then return.

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

                  10. @@ -84298,15 +84301,9 @@ dictionary CloseWatcherOptions {

                  The requestClose() method steps given a - dialog element subject:

                  - -
                    -
                  1. If subject is connected and subject's - node document is fully active, then - request to close subject's - internal close watcher with false.

                  2. -
                  + data-x="dom-CloseWatcher-requestClose">requestClose()
                  method steps are to request to close this's internal + close watcher with false.

                  The close() method steps are to close this's From 268ba08aa2e36e6440cf4d19077df29672be1615 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 22 May 2025 09:30:23 +0100 Subject: [PATCH 20/32] add then --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index f2bead0d824..725b42295cf 100644 --- a/source +++ b/source @@ -62477,7 +62477,7 @@ interface HTMLDialogElement : HTMLElement {

                2. If value is null, and oldValue is not null, then run the dialog cleanup steps given element.

                3. -
                4. If element is not connected, return.

                5. +
                6. If element is not connected, then return.

                7. If value is not null, and oldValue is null, then run the dialog setup steps given element.

                8. From 5f102449a0dab1d53a64d24b8e45564136b9f96c Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 22 May 2025 09:33:10 +0100 Subject: [PATCH 21/32] collapse single item lists --- source | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/source b/source index 725b42295cf..fee6c917d7e 100644 --- a/source +++ b/source @@ -62435,27 +62435,17 @@ interface HTMLDialogElement : HTMLElement { insertedNode, are:

                    -
                  1. -

                    If insertedNode has an open attribute and - is connected:

                    - -
                      -
                    1. Run the dialog setup steps given insertedNode.

                    2. -
                    -
                  2. +
                  3. If insertedNode has an open attribute + and is connected, then run the dialog setup steps given + insertedNode.

                  The dialog HTML element removing steps, given removedNode and oldParent, are:

                    -
                  1. -

                    If removedNode has an open attribute:

                    - -
                      -
                    1. Run the dialog cleanup steps given removedNode.

                    2. -
                    -
                  2. +
                  3. If removedNode has an open attribute, + then run the dialog cleanup steps given removedNode.

                  4. If removedNode's node document's top layer contains removedNode, then remove an element from From 383e523670611781d4cde65d3973d540a8ce45f3 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Fri, 23 May 2025 15:48:00 +0100 Subject: [PATCH 22/32] clean up var/span/subject/this --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index fee6c917d7e..4c708abc339 100644 --- a/source +++ b/source @@ -62329,7 +62329,7 @@ interface HTMLDialogElement : HTMLElement {

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

                  6. -
                  7. If this is not connected or subject's +

                  8. If this is not connected or this's node document is not fully active, then return.

                  9. .
                  10. Assert: this's close From d9d538d6c1951742bd11d14265b8db0a090bbe87 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Fri, 23 May 2025 15:48:27 +0100 Subject: [PATCH 23/32] remove commas --- source | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source b/source index 4c708abc339..0cefa0d45ef 100644 --- a/source +++ b/source @@ -62464,12 +62464,12 @@ interface HTMLDialogElement : HTMLElement {

                  11. If localName is not open, then return.

                  12. -
                  13. If value is null, and oldValue is not null, then run the +

                  14. If value is null and oldValue is not null, then run the dialog cleanup steps given element.

                  15. If element is not connected, then return.

                  16. -
                  17. If value is not null, and oldValue is null, then run the +

                  18. If value is not null and oldValue is null, then run the dialog setup steps given element.

                  @@ -62841,7 +62841,7 @@ interface HTMLDialogElement : HTMLElement { node document's open dialogs list.

                9. -

                  If subject's close watcher is not null, +

                  If subject's close watcher is not null and subject does not have an open attribute, then:

                  From f830c2b765faf63f404b89e509e5be3ac828ee5d Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Fri, 23 May 2025 16:01:27 +0100 Subject: [PATCH 24/32] add note for why element connected check isnt before dialog cleanup --- source | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source b/source index c45b9c2d8d7..c83f80b87d3 100644 --- a/source +++ b/source @@ -62473,7 +62473,13 @@ interface HTMLDialogElement : HTMLElement {
                10. If value is null and oldValue is not null, then run the dialog cleanup steps given element.

                11. -
                12. If element is not connected, then return.

                13. +
                14. +

                  If element is not connected, then return.

                  + +

                  This ensures that the dialog setup steps are not run on nodes that are + disconnected, which would result in a CloseWatcher being established. The dialog cleanup steps + need no such guard.

                  +
                15. If value is not null and oldValue is null, then run the dialog setup steps given element.

                16. From 2044edd40da7d239bf379dbbc97ed7cb510ba825 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Tue, 17 Jun 2025 11:38:15 +0100 Subject: [PATCH 25/32] switch to assert the dialog close watcher is not null --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 077301e264f..a62c569d988 100644 --- a/source +++ b/source @@ -62583,8 +62583,8 @@ interface HTMLDialogElement : HTMLElement { element dialog:

                    -
                  1. If dialog's close watcher is not - null, then return.

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

                  4. Assert: dialog has an open attribute and dialog's node document is fully active.

                    From 066ff6e1ea044e7ce2dede4d463f41dedb095ae8 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Tue, 17 Jun 2025 11:39:06 +0100 Subject: [PATCH 26/32] remove open attribute guard --- source | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source b/source index a62c569d988..ce873a75970 100644 --- a/source +++ b/source @@ -62902,8 +62902,7 @@ interface HTMLDialogElement : HTMLElement {
                  5. If subject's close watcher is not null - and subject does not have an open attribute, - then:

                    + and subject, then:

                    1. Destroy subject's Date: Tue, 17 Jun 2025 11:43:16 +0100 Subject: [PATCH 27/32] link concepts in note --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index ce873a75970..3e70f6f9851 100644 --- a/source +++ b/source @@ -62485,8 +62485,8 @@ interface HTMLDialogElement : HTMLElement {

                      If element is not connected, then return.

                      This ensures that the dialog setup steps are not run on nodes that are - disconnected, which would result in a CloseWatcher being established. The dialog cleanup steps - need no such guard.

                      + disconnected, which would result in a CloseWatcher being established. The + dialog cleanup steps need no such guard.

                    2. If value is not null and oldValue is null, then run the From fa98a1cac01598f18b2ca869ce5ab889afbac0fa Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 18 Jun 2025 09:47:10 +0100 Subject: [PATCH 28/32] add active checks for attribute changed/insertion --- source | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source b/source index 3e70f6f9851..678eb53f2a0 100644 --- a/source +++ b/source @@ -62449,6 +62449,9 @@ interface HTMLDialogElement : HTMLElement { insertedNode, are:

                        +
                      1. If insertedNode's node document is not fully active, + then return.

                      2. +
                      3. If insertedNode has an open attribute and is connected, then run the dialog setup steps given insertedNode.

                      4. @@ -62478,6 +62481,9 @@ interface HTMLDialogElement : HTMLElement {
                      5. If localName is not open, then return.

                      6. +
                      7. If element's node document is not fully active, then + return.

                      8. +
                      9. If value is null and oldValue is not null, then run the dialog cleanup steps given element.

                      10. From 3da983bf8b980aa49136598f2778027c2344a95e Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 18 Jun 2025 09:47:30 +0100 Subject: [PATCH 29/32] s/CloseWatcher/close watcher --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 678eb53f2a0..3891a0ee4b2 100644 --- a/source +++ b/source @@ -62491,7 +62491,7 @@ interface HTMLDialogElement : HTMLElement {

                        If element is not connected, then return.

                        This ensures that the dialog setup steps are not run on nodes that are - disconnected, which would result in a CloseWatcher being established. The + disconnected, which would result in a close watcher being established. The dialog cleanup steps need no such guard.

                        From 933886702b1573c685e2a273c10cee136495f25b Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 18 Jun 2025 09:47:38 +0100 Subject: [PATCH 30/32] s/code/span --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 3891a0ee4b2..7d3019b1bf4 100644 --- a/source +++ b/source @@ -62492,7 +62492,7 @@ interface HTMLDialogElement : HTMLElement {

                        This ensures that the dialog setup steps are not run on nodes that are disconnected, which would result in a close watcher being established. The - dialog cleanup steps need no such guard.

                        + dialog cleanup steps need no such guard.

                      11. If value is not null and oldValue is null, then run the From 513b7acbdab551a9839839391d01eb32f42d3102 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 18 Jun 2025 09:47:54 +0100 Subject: [PATCH 31/32] remove erroneous "and subject" --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 7d3019b1bf4..24dad220d0f 100644 --- a/source +++ b/source @@ -62907,8 +62907,8 @@ interface HTMLDialogElement : HTMLElement { node document's open dialogs list.

                      12. -

                        If subject's close watcher is not null - and subject, then:

                        +

                        If subject's close watcher is not + null, then:

                        1. Destroy subject's Date: Thu, 19 Jun 2025 09:46:28 +0100 Subject: [PATCH 32/32] s/code/span --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 24dad220d0f..5018e21764c 100644 --- a/source +++ b/source @@ -62491,7 +62491,7 @@ interface HTMLDialogElement : HTMLElement {

                          If element is not connected, then return.

                          This ensures that the dialog setup steps are not run on nodes that are - disconnected, which would result in a close watcher being established. The + disconnected, which would result in a close watcher being established. The dialog cleanup steps need no such guard.