- From: Nick Coury <notifications@github.com>
- Date: Tue, 10 Oct 2023 10:34:12 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/809/1755924061@github.com>
It would help avoid the partial node insertions and nested parent checks, but would still require us to create our own queueing/callback system when `closingTagParsed === false`. Possible shapes of the solution I had in mind: ### MutationObserver closingTag event To avoid backward compatibility issues, opt-in with `const config = { closingTagEvent: true };` which would either emit on all closing tags, or only on nodes where `closingTagParsed === false` initially to reduce events emitted. This might present a performance bottleneck with potentially double the callbacks, but would otherwise be simple to use by just watching for `closingTagParsed === true` in existing handler logic to only handle complete tags. ### onClosed callback Introduce an explicit callback on either a node or a mutation: ``` if (record.closingTagParsed === false) { record.onClosed((node) => { document.body.appendChild(node); }); } // or if (record.closingTagParsed === false) { record.target.onClosed(() => { // Handle complete node document.body.appendChild(record.target); }); } ``` This could introduce other performance bottlenecks but is more explicit. If the node is already complete it would fire immediately. Otherwise it would fire once the node closing tag is parsed. -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/809#issuecomment-1755924061 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/809/1755924061@github.com>
Received on Tuesday, 10 October 2023 17:34:18 UTC