Skip to content

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

Closed

Description

@noamr

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

w3ctag/design-reviews#976

Mozilla standards-positions issue URL

mozilla/standards-positions#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 whatwg/dom#1255. Would love to shape this together with WebKit + Mozilla.

Activity

  1. changed the title [-]State-preserving move (`Node.prototype.moveBefore`)[/-] [+]DOM State-preserving move (`Node.prototype.moveBefore`)[/+] on Jul 23, 2024
  2. added
    topic: dom
    from: Google
    on Jul 23, 2024
  3. annevk commented on Aug 30, 2024

    @annevk
    Contributor

    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.

  4. KaruppuTiger commented on Jul 13, 2026

    @KaruppuTiger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

from: Googleposition: supporttopic: domvenue: WHATWG DOM Workstream

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions