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

Guard showModal() and showPopover() with fully active checks #10705

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
26 changes: 11 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -61620,6 +61620,9 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<li><p>If <span>this</span> 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
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
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>

Expand Down Expand Up @@ -61649,9 +61652,8 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
to the top layer</span> given <span>this</span>.</p></li>

<li id="canceling-dialogs">
<p>If <span>this</span>'s <span>node document</span> is <span>fully active</span>, then set
<span>this</span>'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
<p>Set <span>this</span>'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
<span>this</span>'s <span>relevant global object</span>, with:</p>

<ul>
Expand All @@ -61665,10 +61667,6 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
<li><p><i data-x="create-close-watcher-closeAction">closeAction</i> being to <span>close the
dialog</span> given <span>this</span> and null.</p></li>
</ul>

<p class="XXX">It would be better if this method failed early for the non-<span>fully
active</span> case. That is being tracked in <a
href="https://github.com/whatwg/html/issues/10659">issue #10659</a>.</p>
</li>

<li><p>Set <span>this</span>'s <span>previously focused element</span> to the
Expand Down Expand Up @@ -85397,10 +85395,9 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
</li>

<li id="canceling-popovers">
<p>If <var>document</var> is <span>fully active</span>, then set <var>element</var>'s
<span>popover close watcher</span> to the result of <span data-x="establish a close
watcher">establishing a close watcher</span> given <var>element</var>'s <span>relevant global
object</span>, with:</p>
<p>Set <var>element</var>'s <span>popover close watcher</span> to the result of <span
data-x="establish a close watcher">establishing a close watcher</span> given
<var>element</var>'s <span>relevant global object</span>, with:</p>

<ul>
<li><p><i data-x="create-close-watcher-cancelAction">cancelAction</i> being to return
Expand All @@ -85410,10 +85407,6 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
data-x="hide popover algorithm">hide a popover</span> given <var>element</var>, true, true,
and false.</p></li>
</ul>

<p class="XXX">It would be better if this algorithm failed early for the non-<span>fully
active</span> case. That is being tracked in <a
href="https://github.com/whatwg/html/issues/10659">issue #10659</a>.</p>
</li>
</ol>
</li>
Expand Down Expand Up @@ -85956,6 +85949,9 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<ul>
<li><p><var>element</var> is not <span>connected</span>;</p></li>

<li><p><var>element</var>'s <span>node document</span> is not <span>fully
active</span>;</p></li>

<li><p><var>expectedDocument</var> is not null and <var>element</var>'s <span>node
document</span> is not <var>expectedDocument</var>;</p></li>

Expand Down