Re: [whatwg/dom] [DRAFT] Propagate events into the event's source's tree where appropriate. (PR #1377)

dandclark left a comment (whatwg/dom#1377)

I did run into a variation of the issue that @keithamus raised here when updating some reference target tests to account for the new event propagation behavior. I worked around it by checking `event.composedPath()[0]`, which for an open shadow root shows the original target inside the shadow root; checking that is roughly equivalent to the `.wasOriginallyDespatchedInTheTargetsShadowButNowIsBeingRedespatchedInThisTreeBecauseYourSourceElementMightWantToKnowAboutIt` suggested by Keith above. For an example see [here](https://github.com/web-platform-tests/wpt/blob/87b3cb97baf3c25617decb1e37f7d21ce6f3fd82/shadow-dom/reference-target/tentative/interestfor.tentative.html#L56).

This doesn't work for closed shadows though. But I'm not convinced this will be a problem for real-world use cases; the test cases are pretty contrived. It seems like a adding a boolean exposing this information even for closed shadows would be an easy backwards-compatible addition if it did turn out to be a something developers run into problems with for closed shadows.



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

Message ID: <whatwg/dom/pull/1377/c4490856580@github.com>

Received on Tuesday, 19 May 2026 18:34:23 UTC