Skip to content

Investigate using Branched values to handle contexts in selector matches. #1770

@Jym77

Description

@Jym77

Upon matching a selector, instead of returning a true/false answer, we should be able to return a Branched value depending on the Context. This would allow faster re-matching on context change.

With that, we should be able to build a rules tree (Cascade) where rules appears in an element's associated list not only if it matches, but if it may match in at least one context. Then, we can share rule trees between context and get faster style computing in new context (at the cost of needing to evaluate context on branched values even for the default cascade).

We may need a way to store context efficiently, specifically for selectors like :focus-within that may match a huge number of contexts...

Metadata

Metadata

Assignees

No one assigned

    Labels

    PerformanceRelated to a performance improvementResearchTask that need some investigation and experiment

    Type

    No type

    Projects

    Status

    📮 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions