Skip to content

clarification on usage of DocumentFragment.moveBefore() #43960

@randName

Description

@randName

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/moveBefore

What specific section or headline is this issue about?

Description & Examples

What information was incorrect, unhelpful, or incomplete?

I understand that moveBefore is probably here because it is defined on the spec (since Document has it), but does moving an element into a DocumentFragment really make sense?

From what I understand, a DocumentFragment loses all its children after attaching, and new children added remain detached. So there is no state to preserve since the nodes being added could not have been already attached. Or am I missing something here?

I'm also having trouble understanding what the given example is trying to illustrate.

What did you expect to see?

More clarity on what state could be preserved on a detached element that is eligible for being moved into a DocumentFragment

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:WebAPIWeb API docsneeds triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions