Skip to content

[nodesFromRect] why return sequence<Node> and not NodeList? #51

@keithamus

Description

@keithamus

Many APIs returning an array of nodes will use NodeList; querySelectorAll, getElementsByTagName, .labels, etc.

Exceedingly few return sequence<Node>. It might just be assignedNodes().

While I harbour no love for NodeList which feels like a historical choice at this point, it might be surprising for developers to find this returning a sequence<Node> when the only other API to do so is a very obscure feature of ShadowDOM.

I don't think it is necessary to change to NodeList, but I do think the explainer should have a note on the inconsistency. DOM refers to these as "old-style collections" so there is perhaps good literature already, but it was something that stood out for me.

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