Re: [whatwg/dom] Introduce `moveBefore()` state-preserving atomic move API (PR #1307)

@domfarolino commented on this pull request.



> @@ -2652,6 +2652,63 @@ 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 any of the following conditions are true</p>
+
+  <ul>
+   <li><p><var>parent</var> is <a>connected</a> and <var>node</var> is not <a>connected</a>; or</p></li>
+
+   <li><p><var>parent</var> is not <a>connected</a> and <var>node</var> is <a>connected</a>,</p></li>
+  </ul>

Hmm, I'm not sure it provides any more symmetry than the same-document check being enforced in the connected and disconnected case. But yeah I'll just replace this check with the shadow-inclusive root check to unblock this PR, and we'll update the tests.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1307#discussion_r1882174590
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1307/review/2499714970@github.com>

Received on Thursday, 12 December 2024 13:56:44 UTC