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

Define auto popover list in terms of the top layer #8969

Merged
merged 3 commits into from
Mar 3, 2023
Merged
Changes from 2 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
34 changes: 15 additions & 19 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -81787,8 +81787,10 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
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>,
initially empty.</p>
<p>The <code>Document</code> has an <dfn>auto popover list</dfn>, which is a <span>list</span> of
all the elements in the <code>Document</code>'s <span>top layer</span> whose <code
data-x="attr-popover">popover</code> attribute is in the <span
data-x="attr-popover-auto-state">auto state</span>, in the same order.</p>

<p>The <code>Document</code> has a <dfn>popover pointerdown target</dfn>, which is an <span
data-x="HTML elements">HTML element</span> or null, initially null.</p>
Expand Down Expand Up @@ -81923,8 +81925,6 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
the first popover in a stack.</p>
</li>

<li><p>Add <var>element</var> to <var>document</var>'s <span>auto popover list</span>.</p></li>

<li><p>Set <var>element</var>'s <span>previously focused element</span> to null.</p></li>

<li><p>Let <var>originallyFocusedElement</var> be <var>document</var>'s <span>focused area of the
Expand Down Expand Up @@ -82012,21 +82012,17 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<var>element</var>, <var>focusPreviousElement</var>, and <var>fireEvents</var>.</p></li>

<li>
<p>If <var>element</var> is not in <var>document</var>'s <span>auto popover list</span>:</p>

<ol>
<li><p>If <var>throwExceptions</var> is true, then throw an
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
<p>If the result of running <span>check popover validity</span> given <var>element</var>,
true, and <var>throwExceptions</var> is false, then return.</p>

<li><p>Otherwise, return.</p></li>
</ol>
<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> could have disconnected
<var>element</var> or changed its <code data-x="attr-popover">popover</code>
attribute.</p>
</li>

<li><p><span>Assert</span>: The last item in <var>document</var>'s <span>auto popover
<li><p><span>Assert</span>: the last item in <var>document</var>'s <span>auto popover
list</span> is <var>element</var>.</p></li>

<li><p><span data-x="list remove">Remove</span> <var>element</var> from <var>document</var>'s
<span>auto popover list</span>.</p></li>
</ol>
</li>

Expand All @@ -82047,8 +82043,8 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
true, and <var>throwExceptions</var> is false, then return.</p>

<p class="note"><span>Check popover validity</span> is called again because firing the <code
data-x="event-beforetoggle">beforetoggle</code> event could have disconnected this element or
changed its <code data-x="attr-popover">popover</code> attribute.</p>
data-x="event-beforetoggle">beforetoggle</code> event could have disconnected
<var>element</var> or changed its <code data-x="attr-popover">popover</code> attribute.</p>
</li>
</ol>
</li>
Expand Down Expand Up @@ -82169,7 +82165,7 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
elements">HTML element</span> or null.</p>

<div class="note">
<p>The <span>topmost popover ancestor</span> algorithm will return the topmost (highest in the
<p>The <span>topmost popover ancestor</span> algorithm will return the topmost (earliest in the
annevk marked this conversation as resolved.
Show resolved Hide resolved
<span>auto popover list</span>) ancestor popover for the provided popover. Popovers can be
related to each other in several ways, creating a tree of popovers. There are two paths through
which one popover (call it the "child" popover) can have an ancestor popover (call it the
Expand All @@ -82185,7 +82181,7 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
the "parent". The invoker must be in a popover and reference an open popover.</p></li>
</ol>

<p>In each of the relationships formed above, the parent popover must be strictly lower in the
<p>In each of the relationships formed above, the parent popover must be strictly later in the
annevk marked this conversation as resolved.
Show resolved Hide resolved
<span>auto popover list</span> than the child popover, or it does not form a valid ancestral
relationship. This eliminates non-showing popovers and self-pointers (e.g. a popover with an
anchor attribute that points back to the same popover), and it allows for the construction of a
Expand Down