Skip to content

Commit

Permalink
Add popover=hint
Browse files Browse the repository at this point in the history
  • Loading branch information
josepharhar committed Sep 23, 2023
1 parent 210f0ea commit 3033334
Showing 1 changed file with 101 additions and 39 deletions.
140 changes: 101 additions & 39 deletions source
Expand Up @@ -82768,6 +82768,13 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<td>Does not close other popovers; does not <span data-x="popover light dismiss">light
dismiss</span>.</td>
</tr>
<tr>
<td><dfn attr-value for="html-global/popover"><code
data-x="attr-popover-hint">hint</code></dfn></td>
<td><dfn data-x="attr-popover-hint-state">hint</dfn></td>
<td>Closes other hint popovers when opened; has <span data-x="popover light dismiss">light
dismiss</span>; only one can be open at a time.</td>
</tr>
</tbody>
</table>

Expand All @@ -82792,7 +82799,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 a <dfn>popover pointerdown target</dfn>, which is an <span
<p>Every <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>

<p>Every <code>Document</code> has a <dfn>showing hint popover</dfn>, which is an <span
data-x="HTML elements">HTML element</span> or null, initially null.</p>

<p>Every <span data-x="HTML elements">HTML element</span> has a <dfn>popover invoker</dfn>, which
Expand Down Expand Up @@ -82897,7 +82907,8 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {

<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</span> state, then:</p>
data-x="attr-popover-auto-state">auto</span> state or <span
data-x="attr-popover-hint-state">hint</span> state, then:</p>

<ol>
<li><p>Let <var>originalType</var> be the value of <var>element</var>'s <code
Expand All @@ -82909,8 +82920,23 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<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 not <var>nestedShow</var>.</p></li>
<li>
<p>If <var>element</var>'s <code data-x="attr-popover">popover</code> attribute is in the
<span data-x="attr-popover-hint-state">hint</span> state, then:</p>

<ol>
<li><p>If <var>document</var>'s <span>showing hint popover</span> is not null, then run the
<span>hide popover algorithm</span> given <var>document</var>'s <span>showing hint
popover</span>, false, not <var>nestedShow</var>, and <var>throwExceptions</var>.</p></li>

<li><p>If <var>ancestor</var> is not <var>document</var>, then run <span
data-x="hide-all-popovers-until">hide all popovers until</span> given <var>ancestor</var>,
false, and not <var>nestedShow</var>.</p></li>
</ol>
</li>

<li><p>Otherwise, run <span data-x="hide-all-popovers-until">hide all popovers until</span>
given <var>ancestor</var>, false, and not <var>nestedShow</var>.</p></li>

<li><p>If <var>originalType</var> is not equal to the value of <var>element</var>'s <code
data-x="attr-popover">popover</code> attribute, then throw a
Expand Down Expand Up @@ -82938,6 +82964,10 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
</ol>
</li>

<li><p>If <var>element</var>'s <code data-x="attr-popover">popover</code> attribute is in the
<span data-x="attr-popover-hint-state">hint</span> state, then set <var>document</var>'s
<span>showing hint popover</span> to <var>element</var>.</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 @@ -83038,11 +83068,12 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {

<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</span> state, then:</p>
data-x="attr-popover-auto-state">auto</span> state or the <span
data-x="attr-popover-hint-state">hint</span> state, then:</p>

<ol>
<li><p>Run <span data-x="hide-all-popovers-until">hide all popovers until</span> given
<var>element</var>, <var>focusPreviousElement</var>, and <var>fireEvents</var>.</p></li>
<var>element</var>, <var>focusPreviousElement</var>, <var>fireEvents</var>, and false.</p></li>

<li>
<p>If the result of running <span>check popover validity</span> given <var>element</var>,
Expand Down Expand Up @@ -83086,6 +83117,8 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Otherwise, <span>remove an element from the top layer immediately</span> given
<var>element</var>.</p></li>

<li><p>Set <var>document</var>'s <span>showing hint popover</span> to null.</p></li>

<li><p>Set <var>element</var>'s <span>popover visibility state</span> to <span
data-x="popover-hidden-state">hidden</span>.</p></li>

Expand Down Expand Up @@ -83144,7 +83177,8 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {

<p>To <dfn data-x="hide-all-popovers-until">hide all popovers until</dfn>, given an <span
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>
<var>focusPreviousElement</var>, a boolean <var>fireEvents</var>, and a boolean
<var>hideUnrelatedPopovers</var>:</p>

<ol>
<li><p>Let <var>document</var> be <var>endpoint</var>'s <span>node document</span>.</p></li>
Expand Down Expand Up @@ -83174,53 +83208,81 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<var>closeAllOpenPopovers</var> and return.</p></li>

<li><p><span>Assert</span>: <var>endpoint</var>'s <code data-x="attr-popover">popover</code>
attribute is in the <span data-x="attr-popover-auto-state">auto</span> state.</p></li>

<li><p>Let <var>repeatingHide</var> be false.</p></li>
attribute is not in the <span data-x="attr-popover-manual-state">manual</span> state.</p></li>

<li>
<p>Perform the following steps at least once:</p>
<p>If <var>endpoint</var>'s <code data-x="attr-popover">popover</code> attribute is in the
<span data-x="attr-popover-hint-state">hint</span> state, then:</p>

<ol>
<li><p>Let <var>lastToHide</var> be null.</p></li>

<li><p>Let <var>foundEndpoint</var> be false.</p></li>

<li>
<p>For each <var>popover</var> in <var>document</var>'s <span>auto popover list</span>:</p>
<p>If <var>hideUnrelatedPopovers</var> is true, then:</p>

<ol>
<li><p>If <var>popover</var> is <var>endpoint</var>, then set <var>foundEndpoint</var> to
true.</p></li>

<li><p>Otherwise, if <var>foundEndpoint</var> is true, then set <var>lastToHide</var> to
<var>popover</var> and <span>break</span>.</p></li>
<li><p>If <var>document</var>'s <span>showing hint popover</span> is not null and
<var>document</var>'s <span>showing hint popover</span> is not <var>endpoint</var>, then run
the <span>hide popover algorithm</span> given <var>focusPreviousElement</var>,
<var>fireEvents</var>, and <var>throwExceptions</var>.</p></li>

<li><p>While <var>document</var>'s <span>auto popover list</span> is not empty, run the
<span>hide popover algorithm</span> given <var>focusPreviousElement</var>,
<var>fireEvents</var>, and <var>throwExceptions</var>.</p></li>
</ol>
</li>
</ol>
</li>

<li><p>If <var>foundEndpoint</var> is false, then run <var>closeAllOpenPopovers</var> and
return.</p></li>
<li>
<p>Otherwise:</p>

<ol>
<li><p>Let <var>repeatingHide</var> be false.</p></li>

<li>
<p>While <var>lastToHide</var> is not null and <var>lastToHide</var>'s <span>popover
visibility state</span> is <span data-x="popover-showing-state">showing</span> and
<var>document</var>'s <span>auto popover list</span> is not empty:</p>
<p>Perform the following steps at least once:</p>

<ol>
<li><p>Run the <span>hide popover algorithm</span> given <var>document</var>'s <span>auto
popover list</span>'s last element, <var>focusPreviousElement</var>, <var>fireEvents</var>,
and false.</p></li>
</ol>
</li>
<li><p>Let <var>lastToHide</var> be null.</p></li>

<li><p>Set <var>repeatingHide</var> to true if <var>document</var>'s <span>auto popover
list</span> contains <var>endpoint</var> and <var>document</var>'s <span>auto popover
list</span>'s last element is not <var>endpoint</var>, otherwise false.</p></li>
<li><p>Let <var>foundEndpoint</var> be false.</p></li>

<li><p>If <var>repeatingHide</var> is true, then set <var>fireEvents</var> to false.</p></li>
</ol>
<li>
<p>For each <var>popover</var> in <var>document</var>'s <span>auto popover list</span>:</p>

<p>and keep performing them <span>while</span> <var>repeatingHide</var> is true.</p>
<ol>
<li><p>If <var>popover</var> is <var>endpoint</var>, then set <var>foundEndpoint</var> to
true.</p></li>

<li><p>Otherwise, if <var>foundEndpoint</var> is true, then set <var>lastToHide</var> to
<var>popover</var> and <span>break</span>.</p></li>
</ol>
</li>

<li><p>If <var>foundEndpoint</var> is false, then run <var>closeAllOpenPopovers</var> and
return.</p></li>

<li>
<p>While <var>lastToHide</var> is not null and <var>lastToHide</var>'s <span>popover
visibility state</span> is <span data-x="popover-showing-state">showing</span> and
<var>document</var>'s <span>auto popover list</span> is not empty:</p>

<ol>
<li><p>Run the <span>hide popover algorithm</span> given <var>document</var>'s <span>auto
popover list</span>'s last element, <var>focusPreviousElement</var>, <var>fireEvents</var>,
and false.</p></li>
</ol>
</li>

<li><p>Set <var>repeatingHide</var> to true if <var>document</var>'s <span>auto popover
list</span> contains <var>endpoint</var> and <var>document</var>'s <span>auto popover
list</span>'s last element is not <var>endpoint</var>, otherwise false.</p></li>

<li><p>If <var>repeatingHide</var> is true, then set <var>fireEvents</var> to false.</p></li>
</ol>

<p>and keep performing them <span>while</span> <var>repeatingHide</var> is true.</p>
</li>
</ol>
</li>
</ol>

Expand All @@ -83231,7 +83293,7 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {

<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>
false, false, and true.</p>

<p>To find the <dfn>topmost popover ancestor</dfn>, given a <code>Node</code>
<var>newPopover</var>, and an <span data-x="HTML elements">HTML element</span> or null
Expand Down Expand Up @@ -83659,7 +83721,7 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<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>
all popovers until</span> given <var>ancestor</var>, false, true, and true.</p></li>
</ol>
</li>
</ol>
Expand Down

0 comments on commit 3033334

Please sign in to comment.