- From: Steve Orvell <notifications@github.com>
- Date: Wed, 16 Apr 2025 08:45:23 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/736/2809995132@github.com>
sorvell left a comment (whatwg/dom#736) @WebReflection and @FrameMuse Please don't take my stance too negatively; I think `NodeGroup` may be an extremely valuable primitive, but I want to think it through carefully since it's an important core building block. To reiterate what @justinfagnani [mentioned](https://github.com/whatwg/dom/issues/736#issuecomment-2807940071): ```js console.assert(nodeGroup.children[0].parentNode === nodeGroup, 'false when NodeGroup has a parentNode?') ``` I believe this is `true` when the `nodeGroup` has no `parentNode` and `false` when it does. From `children[0]`'s perspective, **this is a new state** that hasn't existed before. Maybe that ends up being *totally fine*, but I think we need to consider it carefully. With respect to traversal: * "downward" basically works because `NodeGroup` maintains live references to its children, even when they are rendered in another container. A container can't "see" a `NodeGroup` inside it, but I think that's intentional? * "upward" doesn't work since a child can't necessarily "see" that it's in a `NodeGroup` since its `parentNode` may or may not be the `NodeGroup`. If we determine this is important and I'm not sure it is, then maybe that just needs an explicit API. For example, just for reference (yes, we are not using Shadow DOM here), when a node is assigned to a `<slot>`, it gets an `assignedSlot` property that references the slot. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/736#issuecomment-2809995132 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/736/2809995132@github.com>
Received on Wednesday, 16 April 2025 15:45:27 UTC