Skip to content

use of oldParent in HTML element removing steps is sometimes wrong #12098

@dbaron

Description

@dbaron

What is the issue with the HTML Standard?

The DOM spec defines removing steps such that oldParent being non-null says that the node is the root of the removed subtree and oldParent being null means that the element is not. Removing steps for a non-root node in a removal do not have access to nodes above the root of the removed subtree. (In implementations I think this may not be the case, though -- I think the equivalent concepts in at least some implementations do have access, so this may be a spec issue only that is not reflected in implementations!)

Two (independent) HTML Element removing steps defined in the HTML spec use oldParent in ways that don't match the way it's actually defined, and seem to assume that it has a different meaning. In particular, I think the following seem broken:

On the other hand, the following two uses (which are related, they're both for <picture>) seem to depend on the current "odd" definition of oldParent:

I suspect the right thing to do here may be to change the parameter passed by the DOM spec to be something different.

cc @josepharhar

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