Skip to content

Form elements not available when form detached from DOM [regression in 3.6.0] #740

@zbynek

Description

@zbynek

The following prints a single input element to console in Chrome:

const form = document.createElement("form");
form.appendChild(document.createElement("input"));
form.remove();
console.log(form.elements);

but in HtmlUnit form.elements becomes empty once form is detached from DOM.

Seems to come from 00ce1ab#diff-ccb37821109ece9c771414e5408dc628f9baf4e80e0ad5c5d16f93e5576ef2a6R609

If the form is detached it would make sense to iterate over its children instead of the whole page.

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