Skip to content

Inconsistency in getAttribute and setAttribute regarding invalid attribute names #3733

Closed
@DemiMarie

Description

@DemiMarie

Currently,

<div #x=y></div>

parses successfully. The #x attribute of the resulting DOM node can be successfully queried using getAttribute — but trying to modify it with setAttribute throws.

It may not be possible to change this, but it is still a poor API, and such documents have no serialization as XML. Perhaps a deprecation warning could be logged when getAttribute is called with such a name?

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