Skip to content

Different behavior for custom elements that extends builtin element. #15085

@edoardocavazza

Description

@edoardocavazza

Describe the bug

I noticed that Svelte behaves differently when it comes to setting properties to a custom element.

When the custom element is autonomous (eg <my-element>), it behaves correctly, passing the attributes as properties.
If instead the custom element extends a builtin element (eg <a is="my-link">) Svelte does not pass the attributes as properties.

The problem I guess comes from this check that checks only the name tag of the node:

export function is_custom_element_node(node) {

Reproduction

https://svelte.dev/playground/hello-world?version=5.19.1#H4sIAAAAAAAAE62NsY7CMBBEf2W1DU1IeitEQjRX3B8QpGxgkQyObXk3XFCUfz_5Du4aSqqRnmbmzehpYDS4G0XDAOx4YK8CyqJY4Nk6FjT7GfUecy8DLJ6rbYyl3NhpZj0Jv-LH4DV_osF6Wj8MEPoLH3Uzzz8qA6sPdi7AV0jutIJlaT5DuAIpDHcg1WT7UVlK6H6HHViBSCJ8AhIgiCnEsq7-BE3r6z5BlZPAyqbFae2sv7b4brf_L5V1RU3rsUDlSdFoGnk5LN_Mqu7kZwEAAA==

Logs

System Info

Svelte 5.19.1 (Playground)

Severity

annoyance

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