Skip to content

Commit 70f2b06

Browse files
committed
Guard showModal() and showPopover() with fully active checks
Closes #10659. This effectively only impacts dialogs and popovers "synthetic" documents, such as those created via document.implementation.createHTMLDocument().
1 parent 55c546a commit 70f2b06

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

source

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61772,6 +61772,9 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6177261772
<li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute, then
6177361773
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
6177461774

61775+
<li><p>If <span>this</span>'s <span>node document</span> is not <span>fully active</span>, then
61776+
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
61777+
6177561778
<li><p>If <span>this</span> is not <span>connected</span>, then throw an
6177661779
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
6177761780

@@ -61801,9 +61804,8 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6180161804
to the top layer</span> given <span>this</span>.</p></li>
6180261805

6180361806
<li id="canceling-dialogs">
61804-
<p>If <span>this</span>'s <span>node document</span> is <span>fully active</span>, then set
61805-
<span>this</span>'s <span data-x="dialog-close-watcher">close watcher</span> to the result of
61806-
<span data-x="establish a close watcher">establishing a close watcher</span> given
61807+
<p>Set <span>this</span>'s <span data-x="dialog-close-watcher">close watcher</span> to the
61808+
result of <span data-x="establish a close watcher">establishing a close watcher</span> given
6180761809
<span>this</span>'s <span>relevant global object</span>, with:</p>
6180861810

6180961811
<ul>
@@ -61817,10 +61819,6 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6181761819
<li><p><i data-x="create-close-watcher-closeAction">closeAction</i> being to <span>close the
6181861820
dialog</span> given <span>this</span> and null.</p></li>
6181961821
</ul>
61820-
61821-
<p class="XXX">It would be better if this method failed early for the non-<span>fully
61822-
active</span> case. That is being tracked in <a
61823-
href="https://github.com/whatwg/html/issues/10659">issue #10659</a>.</p>
6182461822
</li>
6182561823

6182661824
<li><p>Set <span>this</span>'s <span>previously focused element</span> to the
@@ -85549,10 +85547,9 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8554985547
</li>
8555085548

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

8555785554
<ul>
8555885555
<li><p><i data-x="create-close-watcher-cancelAction">cancelAction</i> being to return
@@ -85562,10 +85559,6 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8556285559
data-x="hide popover algorithm">hide a popover</span> given <var>element</var>, true, true,
8556385560
and false.</p></li>
8556485561
</ul>
85565-
85566-
<p class="XXX">It would be better if this algorithm failed early for the non-<span>fully
85567-
active</span> case. That is being tracked in <a
85568-
href="https://github.com/whatwg/html/issues/10659">issue #10659</a>.</p>
8556985562
</li>
8557085563
</ol>
8557185564
</li>
@@ -86108,6 +86101,9 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8610886101
<ul>
8610986102
<li><p><var>element</var> is not <span>connected</span>;</p></li>
8611086103

86104+
<li><p><var>element</var>'s <span>node document</span> is not <span>fully
86105+
active</span>;</p></li>
86106+
8611186107
<li><p><var>expectedDocument</var> is not null and <var>element</var>'s <span>node
8611286108
document</span> is not <var>expectedDocument</var>;</p></li>
8611386109

0 commit comments

Comments
 (0)