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

Fix corner case invoker issue with popover nested inside invoker #10770

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
32 changes: 19 additions & 13 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -48192,8 +48192,9 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
<li><p>Run <var>element</var>'s <dfn>input activation behavior</dfn>, if any, and do nothing
otherwise.</p></li>

<li><p>Run the <span>popover target attribute activation behavior</span> on
<var>element</var>.</p></li>
<li><p>Run the <span>popover target attribute activation behavior</span> given
<var>element</var> and <var>event</var>'s
<span data-x="concept-event-target">target</span>.</p></li>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved
</ol>

<p class="note">Recall that an element's <span>activation behavior</span> runs for both
Expand Down Expand Up @@ -53491,7 +53492,8 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
</li>

<li><p>Run the <span>popover target attribute activation behavior</span> given
<var>element</var>.</p></li>
<var>element</var> and <var>event</var>'s
<span data-x="concept-event-target">target</span>.</p></li>
</ol>

</div>
Expand Down Expand Up @@ -86359,19 +86361,23 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
attribute, <span>limited to only known values</span>.</p>

mfreed7 marked this conversation as resolved.
Show resolved Hide resolved
<p>To run the <dfn>popover target attribute activation behavior</dfn> given a <code>Node</code>
<var>node</var>:</p>
<var>invoker</var> and an <code>EventTarget</code> <var>eventTarget</var>:</p>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<ol>
<li><p>Let <var>popover</var> be <var>node</var>'s <span>popover target element</span>.</p></li>
<li><p>Let <var>popover</var> be <var>invoker</var>'s <span>popover target element</span>.</p></li>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

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

<li><p>If <var>node</var>'s <code data-x="attr-popovertargetaction">popovertargetaction</code>
<li><p>If <var>eventTarget</var> is a <span>shadow-including inclusive descendant</span> of
<var>popover</var>, and <var>popover</var> is a <span>shadow-including inclusive descendant</span>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved
of <var>invoker</var>, then return.</p></li>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<li><p>If <var>invoker</var>'s <code data-x="attr-popovertargetaction">popovertargetaction</code>
attribute is in the <span data-x="attr-popovertargetaction-show">show</span> state and
<var>popover</var>'s <span>popover visibility state</span> is <span
data-x="popover-showing-state">showing</span>, then return.</p></li>

<li><p>If <var>node</var>'s <code data-x="attr-popovertargetaction">popovertargetaction</code>
<li><p>If <var>invoker</var>'s <code data-x="attr-popovertargetaction">popovertargetaction</code>
attribute is in the <span data-x="attr-popovertargetaction-hide">hide</span> state and
<var>popover</var>'s <span>popover visibility state</span> is <span
data-x="popover-hidden-state">hidden</span>, then return.</p></li>
Expand All @@ -86383,23 +86389,23 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Otherwise, if <var>popover</var>'s <span>popover visibility state</span> is <span
data-x="popover-hidden-state">hidden</span> and the result of running <span>check popover
validity</span> given <var>popover</var>, false, false, and null is true, then run <span>show
popover</span> given <var>popover</var>, false, and <var>node</var>.</p></li>
popover</span> given <var>popover</var>, false, and <var>invoker</var>.</p></li>
</ol>

<p>To get the <dfn>popover target element</dfn> given a <code>Node</code> <var>node</var>, perform
<p>To get the <dfn>popover target element</dfn> given a <code>Node</code> <var>invoker</var>, perform
the following steps. They return an <span data-x="HTML elements">HTML element</span> or null.</p>

<ol>
<li><p>If <var>node</var> is not a <span data-x="concept-button">button</span>, then return
<li><p>If <var>invoker</var> is not a <span data-x="concept-button">button</span>, then return
null.</p></li>

<li><p>If <var>node</var> is <span data-x="concept-fe-disabled">disabled</span>, then return
<li><p>If <var>invoker</var> is <span data-x="concept-fe-disabled">disabled</span>, then return
null.</p></li>

<li><p>If <var>node</var> has a <span>form owner</span> and <var>node</var> is a <span
<li><p>If <var>invoker</var> has a <span>form owner</span> and <var>invoker</var> is a <span
data-x="concept-submit-button">submit button</span>, then return null.</p></li>

<li><p>Let <var>popoverElement</var> be the result of running <var>node</var>'s <span data-x="get
<li><p>Let <var>popoverElement</var> be the result of running <var>invoker</var>'s <span data-x="get
the attr-associated element">get the <code data-x="">popovertarget</code>-associated
element</span>.</p></li>

Expand Down