@@ -62628,14 +62628,8 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
62628
62628
<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <span>this</span>, whose
62629
62629
value is the empty string.</p></li>
62630
62630
62631
- <li><p><span>Assert</span>: <span>this</span>'s <span>node document</span>'s <span>open
62632
- dialogs list</span> does not <span data-x="list contains">contain</span>
62633
- <span>this</span>.</p></li>
62634
-
62635
- <li><p>Add <span>this</span> to <span>this</span>'s <span>node document</span>'s <span>open
62636
- dialogs list</span>.</p></li>
62637
-
62638
- <li><p><span>Set the dialog close watcher</span> with <span>this</span>.</p></li>
62631
+ <li><p><span>Assert</span>: <span>this</span>'s <span data-x="dialog-close-watcher">close
62632
+ watcher</span> is not null.</p></li>
62639
62633
62640
62634
<li><p>Set <span>this</span>'s <span>previously focused element</span> to the
62641
62635
<span>focused</span> element.</p></li>
@@ -62768,31 +62762,58 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
62768
62762
62769
62763
<hr>
62770
62764
62771
- <p>The <code>dialog</code> <span>HTML element removing steps</span>, given <var>removedNode</var>
62772
- and <var>oldParent </var>, are:</p>
62765
+ <p>The <code>dialog</code> <span>HTML element insertion steps</span>, given
62766
+ <var>insertedNode </var>, are:</p>
62773
62767
62774
62768
<ol>
62775
- <li>
62776
- <p>If <var>removedNode</var>'s <span data-x="dialog-close-watcher">close watcher</span> is not
62777
- null, then:</p>
62769
+ <li><p>If <var>insertedNode</var>'s <span>node document</span> is not <span>fully active</span>,
62770
+ then return.</p></li>
62778
62771
62779
- <ol>
62780
- <li><p><span data-x="close-watcher-destroy">Destroy</span> <var>removedNode</var>'s <span
62781
- data-x="dialog-close-watcher">close watcher</span>.</p></li>
62772
+ <li><p>If <var>insertedNode</var> has an <code data-x="attr-dialog-open">open</code> attribute
62773
+ and is <span>connected</span>, then run the <span>dialog setup steps</span> given
62774
+ <var>insertedNode</var>.</p></li>
62775
+ </ol>
62782
62776
62783
- <li><p>Set <var>removedNode</var>'s <span data-x="dialog-close-watcher">close watcher</span> to
62784
- null.</p></li>
62785
- </ol>
62786
- </li>
62777
+ <p>The <code>dialog</code> <span>HTML element removing steps</span>, given <var>removedNode</var>
62778
+ and <var>oldParent</var>, are:</p>
62779
+
62780
+ <ol>
62781
+ <li><p>If <var>removedNode</var> has an <code data-x="attr-dialog-open">open</code> attribute,
62782
+ then run the <span>dialog cleanup steps</span> given <var>removedNode</var>.</p></li>
62787
62783
62788
62784
<li><p>If <var>removedNode</var>'s <span>node document</span>'s <span>top layer</span> <span
62789
62785
data-x="list contains">contains</span> <var>removedNode</var>, then <span>remove an element from
62790
62786
the top layer immediately</span> given <var>removedNode</var>.</p></li>
62791
62787
62792
62788
<li><p>Set <span>is modal</span> of <var>removedNode</var> to false.</p></li>
62789
+ </ol>
62790
+
62791
+ <p>The following <span data-x="concept-element-attributes-change-ext">attribute change
62792
+ steps</span>, given <var>element</var>, <var>localName</var>, <var>oldValue</var>,
62793
+ <var>value</var>, and <var>namespace</var> are used for <code>dialog</code> elements:</p>
62794
+
62795
+ <ol>
62796
+ <li><p>If <var>namespace</var> is not null, then return.</p></li>
62793
62797
62794
- <li><p><span data-x="list remove">Remove</span> <var>removedNode</var> from
62795
- <var>removedNode</var>'s <span>node document</span>'s <span>open dialogs list</span>.</p></li>
62798
+ <li><p>If <var>localName</var> is not <code data-x="attr-dialog-open">open</code>, then
62799
+ return.</p></li>
62800
+
62801
+ <li><p>If <var>element</var>'s <span>node document</span> is not <span>fully active</span>, then
62802
+ return.</p></li>
62803
+
62804
+ <li><p>If <var>value</var> is null and <var>oldValue</var> is not null, then run the
62805
+ <span>dialog cleanup steps</span> given <var>element</var>.</p></li>
62806
+
62807
+ <li>
62808
+ <p>If <var>element</var> is not <span>connected</span>, then return.</p>
62809
+
62810
+ <p class=note>This ensures that the dialog setup steps are not run on nodes that are
62811
+ disconnected, which would result in a <span>close watcher</span> being established. The
62812
+ <span>dialog cleanup steps</span> need no such guard.</p>
62813
+ </li>
62814
+
62815
+ <li><p>If <var>value</var> is not null and <var>oldValue</var> is null, then run the
62816
+ <span>dialog setup steps</span> given <var>element</var>.</p></li>
62796
62817
</ol>
62797
62818
62798
62819
<p>To <dfn>show a modal dialog</dfn> given a <code>dialog</code> element <var>subject</var> and an
@@ -62838,14 +62859,10 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
62838
62859
<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <var>subject</var>, whose
62839
62860
value is the empty string.</p></li>
62840
62861
62841
- <li><p>Set <span>is modal</span> of <var>subject</var> to true.</p></li>
62842
-
62843
- <li><p><span>Assert</span>: <var>subject</var>'s <span>node document</span>'s <span>open
62844
- dialogs list</span> does not <span data-x="list contains">contain</span>
62845
- <var>subject</var>.</p></li>
62862
+ <li><p><span>Assert</span>: <var>subject</var>'s <span data-x="dialog-close-watcher">close
62863
+ watcher</span> is not null.</p></li>
62846
62864
62847
- <li><p>Add <var>subject</var> to <var>subject</var>'s <span>node document</span>'s <span>open
62848
- dialogs list</span>.</p></li>
62865
+ <li><p>Set <span>is modal</span> of <var>subject</var> to true.</p></li>
62849
62866
62850
62867
<li>
62851
62868
<p>Set <var>subject</var>'s <span>node document</span> to be <span data-x="blocked by a modal
@@ -62863,8 +62880,6 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
62863
62880
already <span data-x="list contains">contain</span> <var>subject</var>, then <span>add an element
62864
62881
to the top layer</span> given <var>subject</var>.</p></li>
62865
62882
62866
- <li><p><span>Set the dialog close watcher</span> with <var>subject</var>.</p></li>
62867
-
62868
62883
<li><p>Set <var>subject</var>'s <span>previously focused element</span> to the
62869
62884
<span>focused</span> element.</p></li>
62870
62885
@@ -62891,6 +62906,13 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
62891
62906
element <var>dialog</var>:</p>
62892
62907
62893
62908
<ol>
62909
+ <li><p><span>Assert</span>: <span>dialog</span>'s
62910
+ <span data-x="dialog-close-watcher">close watcher</span> is not null.</p></li>
62911
+
62912
+ <li><p><span>Assert</span>: <var>dialog</var> has an <code data-x="attr-dialog-open">open</code>
62913
+ attribute and <var>dialog</var>'s <span>node document</span> is <span>fully active</span>.</p>
62914
+ </li>
62915
+
62894
62916
<li>
62895
62917
<p>Set <var>dialog</var>'s <span data-x="dialog-close-watcher">close watcher</span> to the
62896
62918
result of <span data-x="establish a close watcher">establishing a close watcher</span> given
@@ -63011,9 +63033,6 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
63011
63033
63012
63034
<li><p>Set <span>is modal</span> of <var>subject</var> to false.</p></li>
63013
63035
63014
- <li><p><span data-x="list remove">Remove</span> <var>subject</var> from <var>subject</var>'s
63015
- <span>node document</span>'s <span>open dialogs list</span>.</p></li>
63016
-
63017
63036
<li><p>If <var>result</var> is not null, then set <var>subject</var>'s <code
63018
63037
data-x="dom-dialog-returnValue">returnValue</code> attribute to <var>result</var>.</p></li>
63019
63038
@@ -63041,19 +63060,6 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
63041
63060
<li><p><span>Queue an element task</span> on the <span>user interaction task source</span> given the
63042
63061
<var>subject</var> element to <span data-x="concept-event-fire">fire an event</span> named
63043
63062
<code data-x="event-close">close</code> at <var>subject</var>.</p></li>
63044
-
63045
- <li>
63046
- <p>If <var>subject</var>'s <span data-x="dialog-close-watcher">close watcher</span> is not null,
63047
- then:</p>
63048
-
63049
- <ol>
63050
- <li><p><span data-x="close-watcher-destroy">Destroy</span> <var>subject</var>'s <span
63051
- data-x="dialog-close-watcher">close watcher</span>.</p></li>
63052
-
63053
- <li><p>Set <var>subject</var>'s <span data-x="dialog-close-watcher">close watcher</span> to
63054
- null.</p></li>
63055
- </ol>
63056
- </li>
63057
63063
</ol>
63058
63064
63059
63065
<p>To <dfn data-x="dialog-request-close">request to close</dfn> <code>dialog</code> element
@@ -63064,6 +63070,9 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
63064
63070
<li><p>If <var>subject</var> does not have an <code data-x="attr-dialog-open">open</code>
63065
63071
attribute, then return.</p></li>
63066
63072
63073
+ <li><p>If <var>subject</var> is not <span>connected</span> or <var>subject</var>'s
63074
+ <span>node document</span> is not <span>fully active</span>, then return.</p></li>.
63075
+
63067
63076
<li><p><span>Assert</span>: <var>subject</var>'s <span data-x="dialog-close-watcher">close
63068
63077
watcher</span> is not null.</p></li>
63069
63078
@@ -63189,6 +63198,45 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
63189
63198
<li><p>Set <var>topDocument</var>'s <span>autofocus processed flag</span> to true.</p></li>
63190
63199
</ol>
63191
63200
63201
+ <p>The <dfn>dialog setup steps</dfn>, given a <code>dialog</code> element <var>subject</var>, are
63202
+ as follows:</p>
63203
+
63204
+ <ol>
63205
+ <li><p><span>Assert</span>: <var>subject</var> has an <code data-x="attr-dialog-open">open</code>
63206
+ attribute.</p></li>
63207
+
63208
+ <li><p><span>Assert</span>: <var>subject</var> is <span>connected</span>.</p></li>
63209
+
63210
+ <li><p><span>Assert</span>: <var>subject</var>'s <span>node document</span>'s <span>open dialogs
63211
+ list</span> does not <span data-x="list contains">contain</span> <var>subject</var>.</p></li>
63212
+
63213
+ <li><p>Add <var>subject</var> to <var>subject</var>'s <span>node document</span>'s <span>open
63214
+ dialogs list</span>.</p></li>
63215
+
63216
+ <li><p><span>Set the dialog close watcher</span> with <var>subject</var>.</p></li>
63217
+ </ol>
63218
+
63219
+ <p>The <dfn>dialog cleanup steps</dfn>, given a <code>dialog</code> element <var>subject</var>,
63220
+ are as follows:</p>
63221
+
63222
+ <ol>
63223
+ <li><p><span data-x="list remove">Remove</span> <var>subject</var> from <var>subject</var>'s
63224
+ <span>node document</span>'s <span>open dialogs list</span>.</p></li>
63225
+
63226
+ <li>
63227
+ <p>If <var>subject</var>'s <span data-x="dialog-close-watcher">close watcher</span> is not
63228
+ null, then:</p>
63229
+
63230
+ <ol>
63231
+ <li><p><span data-x="close-watcher-destroy">Destroy</span> <var>subject</var>'s <span
63232
+ data-x="dialog-close-watcher">close watcher</span>.</p></li>
63233
+
63234
+ <li><p>Set <var>subject</var>'s <span data-x="dialog-close-watcher">close watcher</span> to
63235
+ null.</p></li>
63236
+ </ol>
63237
+ </li>
63238
+ </ol>
63239
+
63192
63240
<h4><dfn>Dialog light dismiss</dfn></h4>
63193
63241
63194
63242
<p class="note">"Light dismiss" means that clicking outside of a <code>dialog</code> element whose <code
0 commit comments