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

Add "hide all popovers" algorithm #8886

Merged
merged 6 commits into from
Feb 23, 2023
Merged
Changes from 5 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
27 changes: 20 additions & 7 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -59698,8 +59698,8 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
and a boolean <var>isModal</var>, are as follows:</p>

<ol>
<li><p>Run <span data-x="hide-all-popovers-until">hide all popovers until</span> given null,
false, and true.</p></li>
<li><p>Run <span>hide all popovers</span> given <var>subject</var>'s <span>node
document</span>.</p></li>

<li><p>Let <var>control</var> be null.</p></li>

Expand Down Expand Up @@ -81489,14 +81489,16 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
must <span>reflect</span> the <span data-x="attr-popover">popover</span> attribute, <span>limited
to only known values</span>.</p>

<p>Every <span data-x="HTML elements">HTML element</span> has a <dfn>popover visibility
<p>Every <span data-x="HTML elements">HTML element</span> has a <dfn export>popover visibility
state</dfn>, initially <span data-x="popover-hidden-state">hidden</span>, with these potential
values:</p>

<ul>
<li><p><dfn data-x="popover-hidden-state">hidden</dfn></p></li>
<li><p><dfn export for="popover visibility state"
data-x="popover-hidden-state">hidden</dfn></p></li>

<li><p><dfn data-x="popover-showing-state">showing</dfn></p></li>
<li><p><dfn export for="popover visibility state"
data-x="popover-showing-state">showing</dfn></p></li>
</ul>

<p>The <code>Document</code> has an <dfn>auto popover list</dfn>, which is a <span>list</span>,
Expand Down Expand Up @@ -81622,6 +81624,9 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Let <var>ancestor</var> be the result of running the <span>topmost popover
ancestor</span> algorithm given <var>element</var>.</p></li>

<li><p>If <var>ancestor</var> is null, then set <var>ancestor</var> to
<var>document</var>.</p></li>

<li><p>Run <span data-x="hide-all-popovers-until">hide all popovers until</span> given
<var>ancestor</var>, false, and true.</p></li>

Expand Down Expand Up @@ -81840,11 +81845,12 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
</ol>
annevk marked this conversation as resolved.
Show resolved Hide resolved

<p>To <dfn data-x="hide-all-popovers-until">hide all popovers until</dfn>, given an <span
data-x="HTML elements">HTML element</span> <var>endpoint</var>, a boolean
data-x="HTML elements">HTML element</span> or <code>Document</code> <var>endpoint</var>, a boolean
<var>focusPreviousElement</var>, and a boolean <var>fireEvents</var>:</p>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved

<ol>
<li><p>Let <var>document</var> be <var>endpoint</var>'s <span>node document</span>.</p></li>
<li><p>Let <var>document</var> be <var>endpoint</var> if endpoint is a <code>Document</code>;
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
otherwise <var>endpoint</var>'s <span>node document</span>.</p></li>

<li>
<p>Let <var>closeAllOpenPopovers</var> be an algorithm which performs the following steps:</p>
Expand Down Expand Up @@ -81907,6 +81913,10 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
happens. For example, during light-dismiss of a popover, this algorithm ensures that we close only
the popovers that aren't related to the node clicked by the user.</p>

<p>To <dfn export>hide all popovers</dfn>, given a <code>Document</code> <var>document</var>, run
<span data-x="hide-all-popovers-until">hide all popovers until</span> given <var>document</var>,
false, and false.</p>

<p>To find the <dfn>topmost popover ancestor</dfn>, given a <code>Node</code>
<var>newPopover</var>, perform the following steps. They return an <span data-x="HTML
elements">HTML element</span> or null.</p>
Expand Down Expand Up @@ -82304,6 +82314,9 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {

<li><p>Set <var>document</var>'s <span>popover pointerdown target</span> to null.</p></li>

<li><p>If <var>ancestor</var> is null, then set <var>ancestor</var> to
<var>document</var>.</p></li>

<li><p>If <var>sameTarget</var> is true, then run <span data-x="hide-all-popovers-until">hide
all popovers until</span> given <var>ancestor</var>, false, and true.</p></li>
</ol>
Expand Down