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

[Editorial] separate out showModal steps into own algorithm #10961

Merged
Merged
Changes from all 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
64 changes: 34 additions & 30 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -61960,22 +61960,25 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
</ol>

<p>The <dfn method for="HTMLDialogElement"><code
data-x="dom-dialog-showModal">showModal()</code></dfn> method steps are:</p>
data-x="dom-dialog-showModal">showModal()</code></dfn> method steps are to <span>show a modal
dialog</span> given <span>this</span>.</p>

<p>To <dfn>show a modal dialog</dfn> given a <code>dialog</code> element <var>subject</var>:</p>

<ol>
<li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute and
<span>is modal</span> of <span>this</span> is true, then return.</p></li>
<li><p>If <var>subject</var> has an <code data-x="attr-dialog-open">open</code> attribute and
<span>is modal</span> of <var>subject</var> is true, then return.</p></li>

<li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute, then
<li><p>If <var>subject</var> has an <code data-x="attr-dialog-open">open</code> attribute, then
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>If <span>this</span>'s <span>node document</span> is not <span>fully active</span>, then
<li><p>If <var>subject</var>'s <span>node document</span> is not <span>fully active</span>, then
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>If <span>this</span> is not <span>connected</span>, then throw an
<li><p>If <var>subject</var> is not <span>connected</span>, then throw an
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>If <span>this</span> is in the <span data-x="popover-showing-state">popover showing
<li><p>If <var>subject</var> is in the <span data-x="popover-showing-state">popover showing
state</span>, then throw an <span>"<code>InvalidStateError</code>"</span>
<code>DOMException</code>.</p></li>

Expand All @@ -61984,35 +61987,35 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
data-x="dom-Event-cancelable">cancelable</code> attribute initialized to true, the <code
data-x="dom-ToggleEvent-oldState">oldState</code> attribute initialized to "<code
data-x="">closed</code>", and the <code data-x="dom-ToggleEvent-newState">newState</code>
attribute initialized to "<code data-x="">open</code>" at <span>this</span> is false, then
attribute initialized to "<code data-x="">open</code>" at <var>subject</var> is false, then
return.</p></li>

<li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute,
<li><p>If <var>subject</var> has an <code data-x="attr-dialog-open">open</code> attribute,
then return.</p></li>

<li><p>If <span>this</span> is not <span>connected</span>, then return.</p></li>
<li><p>If <var>subject</var> is not <span>connected</span>, then return.</p></li>

<li><p>If <span>this</span> is in the <span data-x="popover-showing-state">popover showing
<li><p>If <var>subject</var> is in the <span data-x="popover-showing-state">popover showing
state</span>, then return.</p></li>

<li><p><span>Queue a dialog toggle event task</span> given <var>subject</var>, "<code
data-x="">closed</code>", and "<code data-x="">open</code>".</p></li>

<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <span>this</span>, whose
<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 <span>is modal</span> of <span>this</span> to true.</p></li>
<li><p>Set <span>is modal</span> of <var>subject</var> to true.</p></li>

<li><p><span>Assert</span>: <span>this</span>'s <span>node document</span>'s <span>open
<li><p><span>Assert</span>: <var>subject</var>'s <span>node document</span>'s <span>open
dialogs list</span> does not <span data-x="list contains">contain</span>
<span>this</span>.</p></li>
<var>subject</var>.</p></li>

<li><p>Add <span>this</span> to <span>this</span>'s <span>node document</span>'s <span>open
<li><p>Add <var>subject</var> to <var>subject</var>'s <span>node document</span>'s <span>open
dialogs list</span>.</p></li>

<li>
<p>Let <span>this</span>'s <span>node document</span> be <span data-x="blocked by a modal
dialog">blocked by the modal dialog</span> <span>this</span>.</p>
<p>Let <var>subject</var>'s <span>node document</span> be <span data-x="blocked by a modal
dialog">blocked by the modal dialog</span> <var>subject</var>.</p>

<p class="note" id="note-dialog-plus-focus-fixup">This will cause the <span>focused area of the
document</span> to become <span>inert</span> (unless that currently focused area is a
Expand All @@ -62022,23 +62025,23 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
focus.</p>
</li>

<li><p>If <span>this</span>'s <span>node document</span>'s <span>top layer</span> does not
already <span data-x="list contains">contain</span> <span>this</span>, then <span>add an element
to the top layer</span> given <span>this</span>.</p></li>
<li><p>If <var>subject</var>'s <span>node document</span>'s <span>top layer</span> does not
already <span data-x="list contains">contain</span> <var>subject</var>, then <span>add an element
to the top layer</span> given <var>subject</var>.</p></li>

<li><p><span>Set the dialog close watcher</span> with <span>this</span>.</p></li>
<li><p><span>Set the dialog close watcher</span> with <var>subject</var>.</p></li>

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

<li><p>Let <var>document</var> be <span>this</span>'s <span>node document</span>.</p></li>
<li><p>Let <var>document</var> be <var>subject</var>'s <span>node document</span>.</p></li>

<li><p>Let <var>hideUntil</var> be the result of running <span>topmost popover ancestor</span>
given <span>this</span>, <var>document</var>'s <span>showing hint popover list</span>, null, and
given <var>subject</var>, <var>document</var>'s <span>showing hint popover list</span>, null, and
false.</p></li>

<li><p>If <var>hideUntil</var> is null, then set <var>hideUntil</var> to the result of running
<span>topmost popover ancestor</span> given <span>this</span>, <var>document</var>'s
<span>topmost popover ancestor</span> given <var>subject</var>, <var>document</var>'s
<span>showing auto popover list</span>, null, and false.</p></li>

<li><p>If <var>hideUntil</var> is null, then set <var>hideUntil</var> to
Expand All @@ -62047,7 +62050,7 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<li><p>Run <span data-x="hide-all-popovers-until">hide all popovers until</span> given
<var>hideUntil</var>, false, and true.</p></li>

<li><p>Run the <span>dialog focusing steps</span> given <span>this</span>.</p></li>
<li><p>Run the <span>dialog focusing steps</span> given <var>subject</var>.</p></li>
</ol>

<p id="canceling-dialogs">To <dfn>set the dialog close watcher</dfn>, given a <code>dialog</code>
Expand All @@ -62061,9 +62064,10 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {

<ul>
<li><p><i data-x="create-close-watcher-cancelAction">cancelAction</i> given
<var>canPreventClose</var> being to return the result of <span data-x="concept-event-fire">firing
an event</span> named <code data-x="event-cancel">cancel</code> at <var>dialog</var>, with the
<code data-x="dom-Event-cancelable">cancelable</code> attribute initialized to
<var>canPreventClose</var> being to return the result of <span
data-x="concept-event-fire">firing an event</span> named <code
data-x="event-cancel">cancel</code> at <var>dialog</var>, with the <code
data-x="dom-Event-cancelable">cancelable</code> attribute initialized to
<var>canPreventClose</var>.</p></li>

<li><p><i data-x="create-close-watcher-closeAction">closeAction</i> being to <span>close the
Expand Down