Skip to content

Commit

Permalink
Make focus async when removing open attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
josepharhar committed Dec 10, 2024
1 parent 5a93291 commit 8fa9712
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -59996,8 +59996,8 @@ fur
<li><p>Otherwise, if <var>submitter</var> has a <span data-x="concept-fe-value">value</span>,
then set <var>result</var> to that <span data-x="concept-fe-value">value</span>.</p></li>

<li><p><span>Close the dialog with attribute changes</span> given <var>subject</var> and
<var>result</var>.</p></li>
<li><p><span>Close the dialog with attribute changes</span> given <var>subject</var>,
<var>result</var>, and false.</p></li>

<li><p>Return.</p></li>
</ol>
Expand Down Expand Up @@ -61732,7 +61732,7 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
return.</p></li>

<li><p>If <var>value</var> is null, then <span>close the dialog</span> given
<var>element</var> and null.</p></li>
<var>element</var>, null, and true.</p></li>
</ol>

<p>The <code data-x="attr-tabindex">tabindex</code> attribute must not be specified on
Expand Down Expand Up @@ -62041,11 +62041,12 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<li><p>Remove <var>subject</var>'s <code data-x="attr-dialog-open">open</code>
attribute.</p></li>

<li><p>Run <span>close the dialog</span> given <var>subject</var> and <var>result</var>.</p></li>
<li><p>Run <span>close the dialog</span> given <var>subject</var>, <var>result</var>, and
false.</p></li>
</ol>

<p>To <dfn>close the dialog</dfn> given a <code>dialog</code> element <var>subject</var> and a
string or null <var>result</var>:</p>
<p>To <dfn>close the dialog</dfn> given a <code>dialog</code> element <var>subject</var>, a
string or null <var>result</var>, and a boolean <var>asyncFocus</var>:</p>

<ol>
<li><p>If the <span>is modal</span> flag of <var>subject</var> is true, then <span>request an
Expand All @@ -62068,11 +62069,21 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {

<li><p>Set <var>subject</var>'s <span>previously focused element</span> to null.</p></li>

<li><p>If <var>subject</var>'s <span>node document</span>'s <span>focused area of the
document</span>'s <span>DOM anchor</span> is a <span>shadow-including inclusive
descendant</span> of <var>element</var>, or <var>wasModal</var> is true, then run the
<span>focusing steps</span> for <var>element</var>; the viewport should not be scrolled by
doing this step.</p></li>
<li>
<p>If <var>subject</var>'s <span>node document</span>'s <span>focused area of the
document</span>'s <span>DOM anchor</span> is a <span>shadow-including inclusive
descendant</span> of <var>element</var>, or <var>wasModal</var> is true, then:</p>

<ol>
<li><p>If <var>asyncFocus</var> is true, then <span>queue an element task</span> on the
<span>user interaction task source</span> given the <var>subject</var> element to run the
<span>focusing steps</span> for <var>element</var>; the viewport should not be scrolled by
doing this step.</p></li>

<li><p>Otherwise, run run the <span>focusing steps</span> for <var>element</var>; the
viewport should not be scrolled by doing this step.</p></li>
</ol>
</li>
</ol>
</li>

Expand Down

0 comments on commit 8fa9712

Please sign in to comment.