From 388ad378fa60da9750edd16ac7eac8a93a02ac2e Mon Sep 17 00:00:00 2001
From: Anne van Kesteren An {{Event}} object is simply named an event. It allows for
signaling that something has occurred, e.g., that an image has completed downloading. An event has an associated relatedTarget (null or an
-{{EventTarget}} object). Unless stated otherwise it is null. A potential event target is null or an {{EventTarget}} object.
- Other specifications use relatedTarget to define a
- An event has associated relatedTargets
+(a list of potential event targets). Unless stated otherwise it is the empty
+list.
+
+ Other specifications use relatedTargets to define a
+ An event has an associated path. A path is a
list of structs. Each struct consists of an
-item (an {{EventTarget}} object), target (null
-or an {{EventTarget}} object), a relatedTarget (null or an
-{{EventTarget}} object), root-of-closed-tree (a boolean), and a
+item (an {{EventTarget}} object), target (a
+potential event target), a
+relatedTargets (a list of
+potential event targets), root-of-closed-tree (a boolean), and a
slot-in-closed-tree (a boolean). A path is initially the
empty list. Specifications may define
-retargeting steps for all or some events.
-The algorithm is passed event, as indicated in the dispatch
-algorithm below.
-
legacy target override flag is only used by HTML and only when
target is a {{Window}} object.
- Let relatedTargets be a new list.
- If target is relatedTarget and target is not
- event's relatedTarget, then return true.
+ For each relatedTarget of event's
+ relatedTargets, append the result of retargeting
+ relatedTarget against target to relatedTargets.
+
+ If relatedTargets contains target and
+ event's relatedTargets does not contain
+ target, then return true.
Append to an event path with event, target,
- targetOverride, relatedTarget, and false.
+ targetOverride, relatedTargets, and false.
Let isActivationEvent be true, if event is a {{MouseEvent}} object and
event's {{Event/type}} attribute is " If parent is assigned, then set slotable to
parent.
- Let relatedTarget be the result of retargeting event's
- relatedTarget against parent if event's
- relatedTarget is non-null, and null otherwise.
+ Let relatedTargets be a new list.
+
+ For each relatedTarget of event's
+ relatedTargets, append the result of retargeting
+ relatedTarget against target to relatedTargets.
If target's root is a
@@ -1197,11 +1201,12 @@ for discussion).
parent.
Append to an event path with event, parent, null,
- relatedTarget, and slot-in-closed-tree.
+ relatedTargets, and slot-in-closed-tree.
- Otherwise, if parent and relatedTarget are identical, then set
- parent to null.
+ Otherwise, if relatedTargets contains parent, then
+ set parent to null.
+
Otherwise, set target to parent and then:
@@ -1212,7 +1217,7 @@ for discussion).
activationTarget to target.
Append to an event path with event, parent,
- target, relatedTarget, and slot-in-closed-tree.
+ target, relatedTargets, and slot-in-closed-tree.
If parent is non-null, then set parent to the result of invoking
@@ -1231,34 +1236,31 @@ for discussion).
For each tuple in event's path, in reverse order:
Set event's {{Event/target}} attribute to the target of the last tuple
- in event's path, that is either tuple or preceding
- tuple, whose target is non-null.
+ Set event's {{Event/target}} attribute to the target of
+ the last tuple in event's path, that is either tuple or
+ preceding tuple, whose target is non-null.
- Set event's relatedTarget to tuple's
- relatedTarget.
+ Set event's relatedTargets to tuple's
+ relatedTargets.
- Run the retargeting steps with event.
-
- If tuple's target is null, then invoke tuple's
- item with event and legacyOutputDidListenersThrowFlag if given.
+ If tuple's target is null, then invoke
+ tuple's item with event and
+ legacyOutputDidListenersThrowFlag if given.
For each tuple in event's path, in order:
Set event's {{Event/target}} attribute to the target of the last tuple
- in event's path, that is either tuple or preceding
- tuple, whose target is non-null.
-
- Set event's relatedTarget to tuple's
- relatedTarget.
+ Set event's {{Event/target}} attribute to the target of
+ the last tuple in event's path, that is either tuple or
+ preceding tuple, whose target is non-null.
- Run the retargeting steps with event.
+ Set event's relatedTargets to tuple's
+ relatedTargets.
- If tuple's target is non-null, then set event's
- {{Event/eventPhase}} attribute to {{Event/AT_TARGET}}.
+ If tuple's target is non-null, then set
+ event's {{Event/eventPhase}} attribute to {{Event/AT_TARGET}}.
Otherwise, set event's {{Event/eventPhase}} attribute to
{{Event/BUBBLING_PHASE}}.
@@ -1266,7 +1268,8 @@ for discussion).
If either event's {{Event/eventPhase}} attribute is {{Event/BUBBLING_PHASE}}
and event's {{Event/bubbles}} attribute is true or event's
{{Event/eventPhase}} attribute is {{Event/AT_TARGET}}, then invoke tuple's
- item with event and legacyOutputDidListenersThrowFlag if given.
+ item with event and
+ legacyOutputDidListenersThrowFlag if given.
Unset event's dispatch flag, stop propagation flag, and
@@ -1298,7 +1301,7 @@ for discussion).
To append to an event path, given an
-event, target, targetOverride, relatedTarget, and a
+event, target, targetOverride, relatedTargets, and a
slot-in-closed-tree, run these steps: Append a new struct to event's path
whose item is target, target is
- targetOverride, relatedTarget is relatedTarget,
+ targetOverride, relatedTargets is relatedTargets,
root-of-closed-tree is root-of-closed-tree, and
slot-in-closed-tree is slot-in-closed-tree.
relatedTarget
attribute. [[UIEVENTS]]
+relatedTarget
attribute or equivalent functionality. [[UIEVENTS]] [[TOUCH-EVENTS]]
event = new Event(type [, eventInitDict])
click
", and false otherwise.
@@ -1182,9 +1184,11 @@ for discussion).
-
-
@@ -1309,7 +1312,7 @@ for discussion).
@@ -5751,6 +5754,8 @@ is an object or one of its shadow-including ancestors.
B, repeat these steps until they return an object:
If A is null, then return null. +
If A's root is not a shadow root, or A's root is a shadow-including inclusive ancestor of B, then return A.