Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to not perform dialog focusing steps #2197

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 38 additions & 19 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -56651,9 +56651,13 @@ dictionary <dfn>RelatedEventInit</dfn> : <span>EventInit</span> {
interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute boolean <span data-x="dom-dialog-open">open</span>;
attribute DOMString <span data-x="dom-dialog-returnValue">returnValue</span>;
[<span>CEReactions</span>] void <span data-x="dom-dialog-show">show</span>();
[<span>CEReactions</span>] void <span data-x="dom-dialog-showModal">showModal</span>();
[<span>CEReactions</span>] void <span data-x="dom-dialog-show">show</span>(optional <span>DialogShowOptions</span> options);
[<span>CEReactions</span>] void <span data-x="dom-dialog-showModal">showModal</span>(optional <span>DialogShowOptions</span> options);
[<span>CEReactions</span>] void <span data-x="dom-dialog-close">close</span>(optional DOMString returnValue);
};

dictionary <dfn>DialogShowOptions</dfn> {
boolean skipInitialFocus = false;
};</pre>
</dd>
</dl><!--TOPIC:HTML-->
Expand Down Expand Up @@ -56704,21 +56708,31 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {

<dl class="domintro">

<dt><var>dialog</var> . <code subdfn data-x="dom-dialog-show">show</code>()</dt>
<dt><var>dialog</var> . <code subdfn data-x="dom-dialog-show">show</code>( [ { skipInitialFocus: true } ] )</dt>

<dd>

<p>Displays the <code>dialog</code> element.</p>

<p>If the <code data-x="">skipInitialFocus</code> option is provided and set to true, then no
<span data-x="dialog focusing steps">additional automatic focusing logic</span> will be
performed. Otherwise, the user agent will attempt to focus the contents of the
<code>dialog</code>, taking into account the <code data-x="attr-fe-autofocus">autofocus</code>
attribute if relevant.</p>

</dd>

<dt><var>dialog</var> . <code subdfn data-x="dom-dialog-showModal">showModal</code>()</dt>
<dt><var>dialog</var> . <code subdfn data-x="dom-dialog-showModal">showModal</code>( [ { skipInitialFocus: true } ] )</dt>

<dd>

<p>Displays the <code>dialog</code> element and makes it the top-most modal dialog.</p>

<p>This method honors the <code data-x="attr-fe-autofocus">autofocus</code> attribute.</p>
<p>If the <code data-x="">skipInitialFocus</code> option is provided and set to true, then no
<span data-x="dialog focusing steps">additional automatic focusing logic</span> will be
performed. Otherwise, the user agent will attempt to focus the contents of the
<code>dialog</code>, taking into account the <code data-x="attr-fe-autofocus">autofocus</code>
attribute if relevant.</p>

</dd>

Expand Down Expand Up @@ -56748,20 +56762,22 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {

<div w-nodev>

<p>When the <dfn><code data-x="dom-dialog-show">show()</code></dfn> method is invoked, the user
agent must run the following steps:</p>
<p>When the <dfn><code data-x="dom-dialog-show">show(<var>options</var>)</code></dfn> method is
invoked, run the following steps:</p>

<ol>

<li><p>If the element already has an <code data-x="attr-dialog-open">open</code> attribute, then
abort these steps.</p></li>
<li><p>If this <code>dialog</code> element already has an <code
data-x="attr-dialog-open">open</code> attribute, then abort these steps.</p></li>

<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to the <code>dialog</code>
<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to this <code>dialog</code>
element, whose value is the empty string.</p></li>

<li><p>Set the <code>dialog</code> to the <span>normal alignment</span> mode.</p></li>
<li><p>Set this <code>dialog</code> to the <span>normal alignment</span> mode.</p></li>

<li><p>Run the <span>dialog focusing steps</span> for the <code>dialog</code> element.</p></li>
<li><p>If the <code data-x="">skipInitialFocusing</code> member of <var>options</var> is not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be skipInitialFocus right ?

present, or if it is present but its value is false, run the <span>dialog focusing steps</span>
for this <code>dialog</code> element.</p></li>

</ol>

Expand All @@ -56776,13 +56792,12 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
the <span>pending dialog stack</span>, it must be <span data-x="top-layer-remove">removed</span>
from the <span>top layer</span>. <ref spec=FULLSCREEN></p>

<p>When the <dfn><code data-x="dom-dialog-showModal">showModal()</code></dfn> method is invoked,
the user agent must run the following steps:</p>
<p>When the <dfn><code data-x="dom-dialog-showModal">showModal(<var>options</var>)</code></dfn>
method is invoked, the user agent must run the following steps:</p>

<ol>

<li><p>Let <var>subject</var> be the <code>dialog</code> element on which the method was
invoked.</p></li>
<li><p>Let <var>subject</var> be this <code>dialog</code> element.</p></li>

<li><p>If <var>subject</var> already has an <code data-x="attr-dialog-open">open</code>
attribute, then throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>
Expand All @@ -56792,7 +56807,8 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code> and abort these
steps.</p></li>

<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <var>subject</var>, whose value is the empty string.</p></li>
<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <var>subject</var>, whose
value is the empty string.</p></li>

<li><p>Set the <code>dialog</code> to the <span>centered alignment</span> mode.</p></li>

Expand All @@ -56802,11 +56818,14 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<li><p>Push <var>subject</var> onto <var>subject</var>'s
<span>node document</span>'s <span>pending dialog stack</span>.</p></li>

<li><p>Run the <span>dialog focusing steps</span> for <var>subject</var>.</p></li>
<li><p>If the <code data-x="">skipInitialFocusing</code> member of <var>options</var> is not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

present, or if it is present but its value is false, run the <span>dialog focusing steps</span>
for <var>subject</var>.</p></li>

</ol>

<p>The <dfn>dialog focusing steps</dfn> for a <code>dialog</code> element <var>subject</var> are as follows:</p>
<p>The <dfn>dialog focusing steps</dfn> for a <code>dialog</code> element <var>subject</var> are
as follows:</p>

<ol>

Expand Down