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

Don't throw when popover/dialog is in requested state #9142

Merged
merged 7 commits into from
May 9, 2023
Merged
Changes from 1 commit
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
25 changes: 20 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -60034,8 +60034,11 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
method steps are:</p>

<ol>
<li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute and the
<span>is modal</span> flag of <span>this</span> is true, then return.</p></li>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved

<li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute, then
return.</p></li>
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved

<li><p>If <span>this</span> is in the <span data-x="popover-showing-state">popover showing
state</span>, then throw an <span>"<code>InvalidStateError</code>"</span>
Expand All @@ -60054,6 +60057,9 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
data-x="dom-dialog-showModal">showModal()</code></dfn> method steps are:</p>

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

<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>

Expand Down Expand Up @@ -82130,8 +82136,8 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<p class="note"><span>Check popover validity</span> is called again because running <span
data-x="hide-all-popovers-until">hide all popovers until</span> above could have fired the
<code data-x="event-beforetoggle">beforetoggle</code> event, and an event handler could have
disconnected this element or called <code data-x="dom-showPopover">showPopover()</code> on
this element.</p>
disconnected this element or changes its <code data-x="attr-popover">popover</code>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
attribute.</p>
</li>
</ol>
</li>
Expand Down Expand Up @@ -82554,18 +82560,27 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
</ol>
</li>

<li><p>If <var>element</var> is not <span>connected</span>, then throw a
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>

<li>
<p>If one of the following conditions is true</p>

<ul>
<li><p><var>element</var> is not <span>connected</span></p></li>

<li><p><var>expectedToBeShowing</var> is true and <var>element</var>'s <span>popover visibility
state</span> is not <span data-x="popover-showing-state">showing</span></p></li>

<li><p><var>expectedToBeShowing</var> is false and <var>element</var>'s <span>popover
visibility state</span> is not <span data-x="popover-hidden-state">hidden</span></p></li>
</ul>

<p>then return false.</p>
</li>

<li>
<p>If one of the following conditions is true</p>

<ul>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
<li><p><var>element</var> is a <code>dialog</code> element and has an <code
data-x="attr-details-open">open</code> attribute</p></li>

Expand Down