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])
Returns a new event whose @@ -1154,15 +1153,18 @@ for discussion).

legacy target override flag is only used by HTML and only when target is a {{Window}} object. -

  • Let relatedTarget be the result of retargeting event's - relatedTarget against target 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 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:

      -
    1. 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. +

    2. 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. -

    3. Set event's relatedTarget to tuple's - relatedTarget. +

    4. Set event's relatedTargets to tuple's + relatedTargets. -

    5. Run the retargeting steps with event. - -

    6. If tuple's target is null, then invoke tuple's - item with event and legacyOutputDidListenersThrowFlag if given. +

    7. 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:

      -
    1. 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. - -

    2. Set event's relatedTarget to tuple's - relatedTarget. +

    3. 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. -

    4. Run the retargeting steps with event. +

    5. Set event's relatedTargets to tuple's + relatedTargets. -

    6. If tuple's target is non-null, then set event's - {{Event/eventPhase}} attribute to {{Event/AT_TARGET}}. +

    7. If tuple's target is non-null, then set + event's {{Event/eventPhase}} attribute to {{Event/AT_TARGET}}.

    8. Otherwise, set event's {{Event/eventPhase}} attribute to {{Event/BUBBLING_PHASE}}. @@ -1282,7 +1284,8 @@ for discussion).

    9. 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:

      @@ -1325,7 +1328,7 @@ for discussion).
    1. 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.

    @@ -5621,6 +5624,8 @@ is an object or one of its shadow-including ancestors. B, repeat these steps until they return an object:

      +
    1. If A is null, then return null. +

    2. If A's root is not a shadow root, or A's root is a shadow-including inclusive ancestor of B, then return A.