- From: Alice <notifications@github.com>
- Date: Mon, 14 Apr 2025 21:11:27 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/1098/2803733327@github.com>
alice left a comment (WICG/webcomponents#1098) #### Submit button with `form` attribute pointing to `<form>` in same shadow root From https://github.com/WICG/webcomponents/issues/1098#issuecomment-2800523352 ```html <x-form id="x-form"> <template shadowRootMode="open" referenceTarget="form"> <form id="form"> <slot></slot> <input type="submit"> </form> </template> <label>Name: <input form="x-form"></label> </x-form> ``` (Steps 1-8 are the same as above.) 9. 🆕 When [a shadow root's get the parent](https://dom.spec.whatwg.org/#ref-for-get-the-parent%E2%91%A6) is invoked on the shadow root, we go to the new logic: > 1. let _target_ be event’s path’s first struct’s invocation target; > 2. if _event_’s composed flag is set, or shadow root is not the root of _target_, return return shadow root’s host; > 3. otherwise, if _event_ has an invoker, and _event_'s invoker's root is a shadow-including ancestor of shadow root, return the result of retargeting _target_ against event's triggering element; > 4. otherwise, return null. _target_ is `form`; the composed flag is _not_ set, shadow root _is_ the root of _target_; event has an invoker, `submitButton`; `submitButton`'s root (shadow root) is _not_ a shadow-including (exclusive) ancestor of shadow root; so, we return null as the parent element. 10. Back in event dispatch the path is again [`form`, shadow root] as it would be normally. 11. Event dispatch continues as normal with the given event path; `composedPath()` works as normal. -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/1098#issuecomment-2803733327 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/1098/2803733327@github.com>
Received on Tuesday, 15 April 2025 04:11:31 UTC