Skip to content

Commit

Permalink
Clarify event retargeting, and mention inertness in the definition of .
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Boxhall committed Mar 22, 2019
1 parent 47a86ee commit 104a982
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3298,6 +3298,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x="event-compositionstart" data-x-href="https://w3c.github.io/uievents/#event-type-compositionstart"><code>compositionstart</code></dfn> event</li>
<li><dfn data-x="event-compositionupdate" data-x-href="https://w3c.github.io/uievents/#event-type-compositionupdate"><code>compositionupdate</code></dfn> event</li>
<li><dfn data-x="event-compositionend" data-x-href="https://w3c.github.io/uievents/#event-type-compositionend"><code>compositionend</code></dfn> event</li>

<li>The <dfn data-x="event-target" data-x-href="https://w3c.github.io/uievents/#event-target">event target</dfn> concept</li>
<li>The <dfn data-x="topmost-event-target" data-x-href="https://w3c.github.io/uievents/#topmost-event-target">topmost event target</dfn> concept</li>
</ul>

<p>The following features are defined in the Touch Events specification: <ref spec=TOUCH></p>
Expand Down Expand Up @@ -54946,8 +54949,9 @@ MIT Room 32-G524

<dd>

<p>Changes the selection to cover the given substring in the given direction. If the direction
is omitted, it will be reset to be the platform default (none or forward).</p>
<p>If <var>element</var> is not <span>inert</span>, changes the selection to cover the given
substring in the given direction. If the direction is omitted, it will be reset to be the
platform default (none or forward).</p>

</dd>

Expand Down Expand Up @@ -72523,20 +72527,35 @@ END:VCARD</pre>
</ul>
</li>

<li><p>if one of the above events would otherwise be fired on the element
as a result of a user interaction, where the process for determining the
event target entails "hit testing", the event must instead be targeted at
the non-inert ancestor of the element which would be the topmost "hit
testing" result for the point at which the interaction occurred, if the inert
element, its inert ancestors, and any unrelated elements were not
present;</p></li>
<li>
<p>if the <span>inert</span> element is the <span data-x="topmost-event-target">topmost event
target</span> for one of the above events, which would be fired as a result of user input, an
alternative <span data-x="event-target">event target</span> must be found as follows:</p>
<ol>
<li><p>Let <var>originalElement</var> be the <span data-x="topmost-event-target">topmost event
target</span> for the event.</p></li>
<li><p>Let <var>candidate</var> be the same element.</p></li>
<li><p>Let <var>ineligible</var> be an empty list.</p></li>
<li>
<p>While <var>candidate</var> is <span>inert</span>, or <var>candidate</var> is not an an
ancestor of <var>originalElement</var>:</p>
<ol>
<li><p>Add <var>candidate</var> to <var>ineligible</var>.</p></li>
<li><p>Let <var>candidate</var> be the element which would be the <span
data-x="topmost-event-target">topmost event target</span> if all the elements in
<var>ineligible</var> were excluded from consideration.</p></li>
</ol>
</li>
<li><p>If <var>candidate</var> is not null, let <var>candidate</var> be the new <span
data-x="event-target">event target</span>.</p></li>
<li><p>Otherwise, do not fire the event.</p></li>
</ol>
</li>

<li><p>the user agent may ignore the node for the purposes of text search user interfaces
(commonly known as "find in page"); and</p></li>

<li><p>the user agent may prevent the user from selecting text in that node, and may prevent
code calling <code data-x="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
on the node.</p></li>
<li><p>the user agent may prevent the user from selecting text in that node.</p></li>
</ul>

<p>User agents should allow the user to override the restrictions on search and text selection,
Expand Down

0 comments on commit 104a982

Please sign in to comment.