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

Make auto popover list an algorithm #9241

Merged
merged 6 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
25 changes: 17 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -82194,11 +82194,6 @@ 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> 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</span> state, 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 @@ -82777,6 +82772,20 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Return true.</p></li>
</ol>

<p>To get the <dfn>auto popover list</dfn> for a <code>Document</code> <var>document</var>:</p>

<ol>
<li><p>Let <var>popovers</var> be « ».</p></li>

<li><p><span data-x="list iterate">For each</span> <code>Element</code> <var>element</var> in
<var>document</var>'s <span>top layer</span>: if <var>element</var>'s <code
data-x="attr-popover">popover</code> attribute is in the <span
data-x="attr-popover-auto-state">auto state</span>, then <span data-x="list append">append</span>
<var>element</var> to <var>popovers</var>.</p></li>

<li><p>Return <var>popovers</var>.</p></li>
</ol>

<h4>The popover target attributes</h4>

<p><span data-x="concept-button">Buttons</span> may have the following content attributes:</p>
Expand Down Expand Up @@ -82946,13 +82955,13 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Let <var>target</var> be <var>event</var>'s <span
data-x="concept-event-target">target</span>.</p></li>

<li><p>Let <var>document</var> be <var>target</var>'s <span>node document</span>.</p></li>

<li><p>Let <var>topmostPopover</var> be the result of running <span>topmost auto popover</span>
given <var>target</var>.</p></li>
given <var>document</var>.</p></li>

<li><p>If <var>topmostPopover</var> is null, then return.</p></li>

<li><p>Let <var>document</var> be <var>target</var>'s <span>node document</span>.</p></li>

<li><p>If <var>event</var> is a <code>PointerEvent</code> and <var>event</var>'s <code
data-x="dom-Event-type">type</code> is <code data-x="event-pointerdown">pointerdown</code>, then:
set <var>document</var>'s <span>popover pointerdown target</span> to the result of running
Expand Down