- From: Claudia Meadows <notifications@github.com>
- Date: Thu, 16 Jan 2025 14:05:23 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 16 January 2025 22:05:27 UTC
> > there really isn't much difference between moving within the same parent and giving it a new parent. > > @dead-claudia that may be true from the user screen perspective, I was talking about actual implementation. From an implementation perspective, the difference is still fairly low. - Persistent render states, like animations, are linked to nodes, not tree positions. As you can always add and remove nodes at will before a given node, linking such states to tree positions turns an O(1) operation to an O(n) operation, something obviously bad. - Browsers do cache tree positions and related style calculations to boost style performance, but this is just an optimization and any insertion and removal necessarily invalidates the parent nodes impacted. They have to compute this for every layout pass, but it almost never changes for individual nodes, so caching it brings very little computational overhead. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/1255#issuecomment-2597004426 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/1255/2597004426@github.com>
Received on Thursday, 16 January 2025 22:05:27 UTC