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 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
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>
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer using list syntax here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is list syntax?

Copy link
Member

Choose a reason for hiding this comment

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

Let popovers be « ».

https://infra.spec.whatwg.org/#lists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, thanks

Copy link
Member

Choose a reason for hiding this comment

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

This isn't quite the language I suggested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I changed it to exactly "Let popovers be « »."


<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 <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
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
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