From ec59294551f2bad7b081b0c6a0bffc7d22cbc864 Mon Sep 17 00:00:00 2001 From: Alice Boxhall <95208+alice@users.noreply.github.com> Date: Tue, 3 Jun 2025 11:07:05 +0200 Subject: [PATCH] Propagate events into the event's source's tree where appropriate. - Add the concept of a "source" for an Event. - Modify shadow root's "get the parent" algorithm such that events propagate into the event's source's tree where appropriate. --- dom.bs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/dom.bs b/dom.bs index 491e2691..ace810a5 100644 --- a/dom.bs +++ b/dom.bs @@ -401,6 +401,9 @@ signaling that something has occurred, e.g., that an image has completed downloa

Other specifications use relatedTarget to define a relatedTarget attribute. [[UIEVENTS]] +

An event has an associated source (a +potential event target). Unless stated otherwise it is null. +

An event has an associated touch target list (a list of zero or more potential event targets). Unless stated otherwise it is the empty list. @@ -6398,10 +6401,22 @@ is null.


A shadow root's get the parent algorithm, given an event, returns -null if event's composed flag is unset and shadow root is the -root of event's path's first struct's -invocation target; otherwise shadow root's -host. +the result of the following steps:

+ +
    +
  1. If event’s composed flag is set, return shadow root’s + host.

  2. +
  3. Let target be event’s path's first struct's + invocation target.

  4. +
  5. Let source be event's source.

  6. +
  7. If shadow root is not the root of target, and either + source is null or shadow root is not the root of + source, return shadow root's host.

  8. +
  9. If source is not null, and source's root is a + shadow-including ancestor of shadow root, return the result of + retargeting target against source.

  10. +
  11. Return null.

  12. +