- From: Anne van Kesteren <notifications@github.com>
- Date: Tue, 26 Nov 2024 00:51:15 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/1255/2500022367@github.com>
The way I am looking at this is whether the method performs a move or not. For the past two-and-half decades the DOM has only had insert and remove. And we've only been able to define a move operation for two same-document connected nodes or two same-shadow-including-root disconnected nodes (I suspect that's sufficient for @sebmarkbage's case cited above). Note that for the connected case it also comes with a new custom element callback (this is not offered in the disconnected case because custom elements never fire callbacks there; only built-in elements appear to have a need for that thus far). Making it implicitly fallback to different semantics prevents us from building upon it in the future. As people would rely on it having insert or remove behavior in a certain set of scenarios. And it would also be rather magical to change the semantics under the hood. You could perhaps have a method `moveBeforeOrMaybeInsert()` but that seems way better to leave to libraries. As again it would lock us into certain behavior we know we don't want. It will be interesting to see the performance aspects explored more. Once there is more data there we should certainly investigate why a couple of conditionals are so expensive. And perhaps adoption of abstractions is so overwhelming that it's indeed compelling to introduce `moveBeforeOrMaybeInsert()` at some point, but not before we are much more confident about the problem space. Also, let me say that this issue has become quite unreadable. Adding way too many duplicate comments (this includes repeating what other people already said, to be clear) in just a couple of days is not a good way to make your case. There's a 160 people watching this repository. We all owe it to them to be more considerate of their time and attention. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/1255#issuecomment-2500022367 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/1255/2500022367@github.com>
Received on Tuesday, 26 November 2024 08:51:19 UTC