Skip to content

Commit

Permalink
Make auto popover list an algorithm
Browse files Browse the repository at this point in the history
Fixes whatwg#9036

This patch also fixes a call to topmost auto popover which was passing
an element instead of a document.
  • Loading branch information
josepharhar committed May 1, 2023
1 parent 2ff2437 commit abcc68d
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -82002,11 +82002,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 @@ -82581,6 +82576,25 @@ 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 an empty <span>list</span>.</p></li>

<li>
<p>For each <code>Element</code> <var>element</var> in <var>document</var>'s <span>top
layer</span>:</p>

<ol>
<li><p>If <var>element</var>'s <span>popover visibility state</span> is <span
data-x="popover-showing-state">showing</span>, then <span data-x="list append">append</span>
<var>element</var> to <var>popovers</var>.</p></li>
</ol>
</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 @@ -82757,13 +82771,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

0 comments on commit abcc68d

Please sign in to comment.