Skip to content

Commit

Permalink
Add attribute changed steps to dialog element
Browse files Browse the repository at this point in the history
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.

# Conflicts:
#	source
  • Loading branch information
lukewarlow committed Feb 1, 2025
1 parent 005b463 commit 1eca429
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -62110,6 +62110,9 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
element <var>dialog</var>:</p>

<ol>
<li><p><span>Assert</span>: <span>dialog</span>'s <span data-x="dialog-close-watcher">close
watcher</span> is null.</p></li>

<li>
<p>Set <var>dialog</var>'s <span data-x="dialog-close-watcher">close watcher</span> to the
result of <span data-x="establish a close watcher">establishing a close watcher</span> given
Expand Down Expand Up @@ -62222,6 +62225,38 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<var>removedNode</var>'s <span>node document</span>'s <span>open dialogs list</span>.</p></li>
</ol>

<p>The following <span data-x="concept-element-attributes-change-ext">attribute change
steps</span>, given <var>element</var>, <var>localName</var>, <var>oldValue</var>,
<var>value</var>, and <var>namespace</var> are used for <code>dialog</code> elements:</p>

<ol>
<li><p>If <var>namespace</var> is not null, then return.</p></li>

<li><p>If <var>localName</var> is not <code data-x="attr-dialog-open">open</code>, then
return.</p></li>

<li><p>If <var>value</var> is null:</p>

<ol>
<li><p><span data-x="list remove">Remove</span> <var>element</var> from <var>element</var>'s
<span>node document</span>'s <span>open dialogs list</span>.</p></li>

<li>
<p>If <var>element</var>'s <span data-x="dialog-close-watcher">close watcher</span> is not
null, then:</p>

<ol>
<li><p><span data-x="close-watcher-destroy">Destroy</span> <var>element</var>'s <span
data-x="dialog-close-watcher">close watcher</span>.</p></li>

<li><p>Set <var>element</var>'s <span data-x="dialog-close-watcher">close watcher</span> to
null.</p></li>
</ol>
</li>
</ol>
</li>
</ol>

<p>When a <code>dialog</code> element <var>subject</var> is to be <dfn data-x="close the
dialog">closed</dfn>, with null or a string <var>result</var>, run these steps:</p>

Expand Down

0 comments on commit 1eca429

Please sign in to comment.