diff --git a/dom.bs b/dom.bs index 0238ee1a8..24015b748 100644 --- a/dom.bs +++ b/dom.bs @@ -466,25 +466,24 @@ dictionary EventInit {
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
-relatedTarget
attribute. [[UIEVENTS]]
+
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
+relatedTarget
attribute or equivalent functionality. [[UIEVENTS]] [[TOUCH-EVENTS]]
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. -
event = new Event(type [, eventInitDict])
legacy target override flag is only used by HTML and only when target is a {{Window}} object. -
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 is relatedTarget and target is not - event's relatedTarget, then return true. +
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 "click
", and false otherwise.
@@ -1198,9 +1200,11 @@ for discussion).
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 @@ -1213,11 +1217,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: @@ -1228,7 +1233,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 @@ -1247,34 +1252,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}}. @@ -1282,7 +1284,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 @@ -1314,7 +1317,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.
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.