Skip to content

[cssom-1] Expose resolved selectorText on CSSStyleRule #10246

Open
@bramus

Description

@bramus

On a CSSStyleRule you can get the selectorText that returns the textual representation of the selector.

With CSS nesting, this value has become somewhat less useful as it doesn’t represent the full selector.

While an author can use script to compute the flattened selector by manually walking the .parentRule to the top and then doing the checks + replacements for &, it would be nice if this was built into the platform. That way, an author can directly use it in something like document.querySelectorAll.

I’m thinking of a property named flattenedSelectorText or fullSelectorText.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions