WebKit / standards-positions

WebKit's positions on emerging web specifications
https://webkit.org/standards-positions/
240 stars 19 forks source link

DOM State-preserving move (`Node.prototype.moveBefore`) #375

Open noamr opened 1 month ago

noamr commented 1 month ago

WebKittens

@annevk

Title of the spec

DOM: Node.prototype.moveBefore

URL to the spec

https://dom.spec.whatwg.org/

URL to the spec's repository

https://github.com/whatwg/dom

Issue Tracker URL

No response

Explainer URL

https://github.com/noamr/dom/blob/spm-explainer/moveBefore-explainer.md

TAG Design Review URL

https://github.com/w3ctag/design-reviews/issues/976

Mozilla standards-positions issue URL

https://github.com/mozilla/standards-positions/issues/1053

WebKit Bugzilla URL

No response

Radar URL

No response

Description

We're proposing a new DOM primitive, Node.prototype.moveBefore, a drop-in replacement for Node.prototype.insertBefore, that allows moving elements in a node tree without incurring state-resets. See details at the explainer and at https://github.com/whatwg/dom/issues/1255. Would love to shape this together with WebKit + Mozilla.

annevk commented 2 weeks ago

I suggest we resolve this as "position: support" one week from now. There are a couple of design aspects that will need to be worked through, such as handling animations and creating a suitable mutation record, but overall this looks like the correct way to add a new tree primitive to the DOM.