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

> This function already returns the new node, like `insertBefore`. As an alternative to throwing, the user code can make the same checks as the browser/spec does. [here for chromium](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/node.cc;l=764?q=dom%2Fnode.cc) and in the spec PR.

But that means that the same check will have to run twice: one in userland and then again in the browser. I get the point of returning the node, so another option could be to pass a typed object as last argument. The browser could then throw if no object is passed, or fill a property (succeed?) with true/false if the object is supplied. You could even fill up that object on why it failed (if throwing different errors is required, for example). Again, I'm here trying to cover both sides.

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

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

Received on Friday, 22 November 2024 17:50:01 UTC