Re: [whatwg/dom] Proposal: a DocumentFragment whose nodes do not get removed once inserted (#736)

@WebReflection (I was the one pinging you on twitter, too) I have a few more questions :):
- after being added to the DOM, must the persistent fragment be continuous? (If not then what happens if I insert a node into the sequence from outside the fragment -- does the node become member of the persistent fragment?)
- what is the reason to group nodes in a live tree into a persistent fragment? What I can think of is to keep track of a group of nodes, and group-apply methods like querySelect, remove, appendChild, etc to it? Is there something more I'm missing.
- is the reason for adding a new node type that every node must have one parent, so one needs to add the fragment itself into the live DOM? (because if the fragment stayed outside of live DOM then the nodes added to live DOM couldn't both point to their live-DOM parent and also to the DocumentFragment-as-currently-implemented-and-thus-outside-the-live-DOM parent?)

For context: how I found this proposal was that I would like to keep track of nodes added from a document fragment so I could update or remove them later. But (differently from this proposal?) after adding the contents of the fragment to live DOM I *wouldn't* add nodes inserted in between the original fragment contents to the fragment. (I.e if a fragment had two <div>s and this was appended to live DOM, then if somebody added (without going through the fragment) a third <div> between the two, then this wouldn't become part of the fragment.)

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

Received on Friday, 15 January 2021 19:44:49 UTC