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

It seems like this API raises a lot of open questions.

Presumably animation & transition states should only be preserved if the element that got atomically moved continues to have the same style which initiated animation applied. It would be nonsensical for an element to retain animations from style rules that no longer apply (otherwise, we'd can end up with dozens of obsolete styles which once applied to an element and still ongoing due to animation / transition).

What does it mean, for example, for focus to be preserved. Would it mean that the focused element will continue to retain the focus regardless of whether it's moved to? It would mean that a bunch of old ancestors will need to receive `focusout` events & new ancestors will need to receive `focusin` events. 

Preserving selection will be even funkier. Since Blink & WebKit don't support discontiguous selection so we can probably only able to preserve the end points of selection. Then the a bunch of nodes in-between old positions of start and end will be deselected, and a bunch of nodes in-between new positions of start and end will be newly selected. We most certainly need to fire selecionchange in that scenario because the bunch of nodes have changed its selection state.

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

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

Received on Monday, 26 August 2024 21:08:53 UTC