Re: [whatwg/dom] Add reference target to shadow root (PR #1353)

@smaug---- commented on this pull request.



> + <li><p>If <var>event</var>'s <a>composed flag</a> is set, then return <var>shadowRoot</var>'s
+ <a for=DocumentFragment>host</a>.
+
+ <li><p>Let <var>target</var> be <var>event</var>'s <a for=Event>path</a>'s first struct's
+ <a for=Event/path>invocation target</a>.
+
+ <li><p>Let <var>source</var> be <var>event</var>'s <a for=Event>source</a>.
+
+ <li><p>If <var>shadowRoot</var> is not the <a for=tree>root</a> of <var>target</var>, and either
+ <var>source</var> is null or <var>shadowRoot</var> is not the <a for=tree>root</a> of
+ <var>source</var>, then return <var>shadowRoot</var>'s <a
+ for=DocumentFragment>host</a>.
+
+ <li><p>If <var>source</var> is not null, and <var>source</var>'s <a for=tree>root</a> is a
+ <a>shadow-including ancestor</a> of <var>shadowRoot</var>, then return the result of
+ <a>retargeting</a> <var>target</var> against <var>source</var>.

As I said in https://github.com/WICG/webcomponents/issues/1098#issuecomment-4511356663 I think we should still investigate relatedTarget model for this. Basically, the relevant events would be composed but propagate only up to the level where .target and .source are different.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1353#pullrequestreview-4381668014
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1353/review/4381668014@github.com>

Received on Thursday, 28 May 2026 14:08:04 UTC