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.
  • Loading branch information
lukewarlow committed Jan 27, 2025
1 parent d2148b9 commit 21886e7
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -61801,6 +61801,37 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
data-x="attr-hidden">hidden</code> attribute to hide it.</p>
</div>

<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>The <code data-x="attr-tabindex">tabindex</code> attribute must not be specified on
<code>dialog</code> elements.</p>

Expand Down Expand Up @@ -62051,6 +62082,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

0 comments on commit 21886e7

Please sign in to comment.