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 6 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
24 changes: 19 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -60038,8 +60038,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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new exception, how certain are we that this is web compatible?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tim convinced me that it's unlikely this will break anything.


<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 @@ -60058,6 +60061,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 @@ -82126,8 +82132,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>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -82554,13 +82560,21 @@ 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>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>element</var> is a <code>dialog</code> element and has an <code
data-x="attr-details-open">open</code> attribute</p></li>
Expand Down