- From: Dominic Farolino <notifications@github.com>
- Date: Sun, 10 Nov 2024 13:02:25 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 10 November 2024 21:02:29 UTC
@domfarolino commented on this pull request. > @@ -2652,6 +2652,50 @@ of a <var>node</var> into a <var>parent</var> before a <var>child</var>, run the <!-- Technically this is post-insert. --> </ol> +<p>To <dfn export for=Node id=concept-node-ensure-pre-move-validity>ensure pre-move validity</dfn> +of a <var>node</var> into a <var>parent</var> before a <var>child</var>, run these steps: + +<ol> + <li><p>If either <var>parent</var> or <var>node</var> are not <a>connected</a>, then + <a>throw</a> a "{{HierarchyRequestError!!exception}}" {{DOMException}}.</p></li> I believe we discussed this at TPAC. The idea is that `moveBefore()` is used to preserve state, so in cases where state cannot be preserved, we should not just fall back to usual `insertBefore()`-style behavior. Instead, we'll throw and let the developer handle this case themselves. Basically we let `moveBefore()` succeed only when we're sure we can perform a state-preserving move, and when disconnected destinations or origins are involved, the state cannot be preserved. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/pull/1307#discussion_r1835781807 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/pull/1307/review/2425851433@github.com>
Received on Sunday, 10 November 2024 21:02:29 UTC