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 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
30 changes: 22 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -60158,8 +60158,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 false, then return.</p></li>

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

<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 @@ -60181,6 +60184,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 @@ -82318,8 +82324,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 changed its <code data-x="attr-popover">popover</code>
attribute.</p>
</li>
</ol>
</li>
Expand Down Expand Up @@ -82747,16 +82753,24 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<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>expectedDocument</var> is not null and <var>element</var>'s <span>node
document</span> is not <var>expectedDocument</var></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>
<li><p><var>element</var> is not <span>connected</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>

<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