Skip to content

Commit 883112d

Browse files
committed
Add pop-up light dismiss logic to event dispatching
This was moved from the HTML spec PR for the popup attribute based on this advice: whatwg/html#8221 (comment) TODO add a better description of this
1 parent c3ca964 commit 883112d

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

dom.bs

+43
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,49 @@ property of the event being dispatched.
13931393
<li><p>Otherwise, set <var>event</var>'s {{Event/eventPhase}} attribute to
13941394
{{Event/CAPTURING_PHASE}}.
13951395

1396+
<li><p>Let <var>target</var> be <var>struct</var>'s <a for=Event/path>invocation target</a>.
1397+
1398+
<li><p>If <var>target</var> is a <a>Document</a>, then:
1399+
1400+
<ol>
1401+
<!-- TODO how do I refer to the HTML spec for "topmost pop-up auto or hint"? -->
1402+
<li><p>Let <var>topmostPopup</var> be the result of running <a>topmost pop-up auto or hint</a>
1403+
given <var>struct</var>'s <a for=Event/path>invocation target</a>.
1404+
1405+
<li><p>If <var>topmostPopup</var> is not null, then:
1406+
1407+
<ol>
1408+
<!-- TODO how do I refer to the pointerdown event? -->
1409+
<li><p>If <var>event</var> is a pointerdown event, then:
1410+
1411+
<ol>
1412+
<li><p>Set <var>target</var>'s <a>pop-up pointerdown target</a> to the result of running
1413+
<a>nearest open ancestral pop-up</a> given <var>target</var> and "<code>inclusive</code>".
1414+
</ol>
1415+
1416+
<li><p>If <var>event</var> is a pointerup event, then:
1417+
1418+
<ol>
1419+
<li><p>Let <var>ancestor</var> be the result of running <a>nearest ancestral open
1420+
pop-up</a> given <var>target</var> and "<code>inclusive</code>".
1421+
1422+
<li><p>Let <var>sameTarget</var> be true if <var>ancestor</var> is <var>target</var>'s
1423+
<a>pop-up pointerdown target</a>.
1424+
1425+
<li><p>Set <var>target</var>'s <a>pop-up pointerdown target</a> to null.
1426+
1427+
<li><p>If <var>sameTarget</var> is true, then run <a>hide all pop-ups until</a> given
1428+
ancestor, false, false, and true.
1429+
</ol>
1430+
1431+
<li><p>If <var>event</var> is a keydown event for the <kbd>Escape</kbd> key, then:
1432+
1433+
<ol>
1434+
<li><p>Run the <a>hide pop-up algorithm</a> given <var>topmostPopup</var>, true, and false.
1435+
</ol>
1436+
</ol>
1437+
</ol>
1438+
13961439
<li><p><a>Invoke</a> with <var>struct</var>, <var>event</var>, "<code>capturing</code>", and
13971440
<var>legacyOutputDidListenersThrowFlag</var> if given.
13981441
</ol>

0 commit comments

Comments
 (0)