ComplexSelector Class

A complex (or relative) selector (https://drafts.csswg.org/selectors-4/#complex).

public sealed class ComplexSelector

Properties

NameDescription
CombinatorsThe combinators; Combinators[i] is between Compounds[i] and Compounds[i + 1].
CompoundsThe compound selectors, left to right.
HasPseudoElementWhether the selector contains a pseudo-element (it then never matches an element).
RelativeCombinatorThe leading combinator of a relative selector (https://drafts.csswg.org/selectors-4/#relative-selector), or null.
SpecificityThe specificity (computed on demand: the specificity of the nesting selector depends on its parent rule).

Combinators

Selector.cs

The combinators; Combinators[i] is between Compounds[i] and Compounds[i + 1].

public ImmutableArray<Combinator> Combinators { get; }

Compounds

Selector.cs

The compound selectors, left to right.

public ImmutableArray<CompoundSelector> Compounds { get; }

HasPseudoElement

Selector.cs

Whether the selector contains a pseudo-element (it then never matches an element).

public bool HasPseudoElement { get; }

Property value

bool

RelativeCombinator

Selector.cs

The leading combinator of a relative selector (https://drafts.csswg.org/selectors-4/#relative-selector), or null.

public Combinator? RelativeCombinator { get; }

Property value

Combinator?

Specificity

Selector.cs

The specificity (computed on demand: the specificity of the nesting selector depends on its parent rule).

public Specificity Specificity { get; }

Property value

Specificity

Methods

NameDescription
ToString()Serializes the selector (https://drafts.csswg.org/cssom/#serialize-a-selector).

ToString()

Selector.cs

Serializes the selector (https://drafts.csswg.org/cssom/#serialize-a-selector).

public override string ToString()

Returns

string