Skip to content

[css-properties-values-api] Registering properties in JS could have performance impact #940

Open
@smfr

Description

@smfr

https://drafts.css-houdini.org/css-properties-values-api-1/
Registering custom properties with the JS API will force the UA to recompute style so that the newly registered properties are applied. However, there's not obvious "right" time to do this, and if the JS runs after the stylesheets have loaded, register properties will trigger potentially--expensive style recomputation.

This also adds another way to trigger expensive "forced style recalc" loops if an author registers multiple properties, asking for computed style after each registration.

For this reason the declarative approach seems preferable to using the JS API.

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