Skip to content

[moveBefore] Consider making this a feature of Node not ParentNode #1385

Not planned
@sorvell

Description

@sorvell

What is the issue with the DOM Standard?

Move before is specified on the ParentNode interface. This means it cannot be used to move a node before a Comment or Text node. This is an unfortunate limitation since it seeminly arbitrarily restricts where an atomic move can be applied.

In particular some web libraries use Comment nodes as markers to separate dynamic renderable "holes" in the DOM. These libraries cannot use moveBefore since it would require inserting before a Comment node.

Activity

WebReflection

WebReflection commented on Jun 24, 2025

@WebReflection

AFAIK they use moveBefore already and you can move before any node, including text and comments so I’m not sure I’m understanding this issue … moveBefore works like insertBefore and that’s what uhtml, lit or others use.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      [moveBefore] Consider making this a feature of Node not ParentNode · Issue #1385 · whatwg/dom