Skip to content

[selectors-4] Consider disallowing :host, :host(), :host-context() inside :has() #7212

@byung-woo

Description

@byung-woo

The only meaningful usage of :host inside :has() is using it with :scope.

  • .b:has(:host .a :scope .c) { color: green }

In the above example, the :scope inside the :has() matches the subject element of the style rule according to the current relative selector absolutizing spec

But as pointed in some other issues (issue 6399, issue 7211), the above expression has the same problem in the below expression. (increasing invalidation complexity)

  • .b:has(:is(:host .a :scope) .c) { color: green }

So, it would be better to use below expression instead of the above.

  • :host .a .b:has(.c) { color: green }

How about disallowing :host, :host(), :host-context() inside :has() to avoid increasing complexity?

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