Re: [whatwg/dom] Atomic move operation for element reparenting & reordering (Issue #1255)

I want to push back lightly on the use cases (e.g. https://github.com/whatwg/dom/issues/1255#issuecomment-2497602719) for throwing to try to understand this more. When exactly is it valuable?

We have a number of obvious cases where state can be affected, for example (1) animation, (2) focus, (3) iframe status. We have 2 important nodes, the container to move to and the target moving element. I think that means these permutations:

| case | container     | target        | throws | state         | preserved |
|------|--------------|---------------|-------|---------------|-----------|
| 1    | connected    | connected     | no    | yes           | yes       |
| 2    | disconnected | disconnected  | no    | no            | no        |
| 3    | connected    | disconnected  | yes   | no            | no        |
| 4    | disconnected | connected     | yes   | yes           | no        |

I can't see any value in throwing for case (3) since there's no relevant state to consider.

That leaves case (4) and the question: is there ever a time where you wouldn't want to remove/disconnect an element to prevent its state from being lost? I'm struggling to find a practical case where that would be desirable.

I also think that moving across documents is a corner case and if we throw there, I suspect people won't care because that likely won't need hot path checking code.

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

Message ID: <whatwg/dom/issues/1255/2499526168@github.com>

Received on Tuesday, 26 November 2024 02:38:07 UTC