|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
A complex selector is a sequence of one or more compound selectors, separated by combinators. More...
#include "donner/css/selectors/ComplexSelector.h"
Classes | |
| struct | Entry |
| A single entry in a complex selector, which is a compound selector and a combinator. More... | |
Public Member Functions | |
| bool | isValid () const |
| Return true if this selector is valid and supported by this implementation. | |
| Specificity::ABC | computeSpecificity () const |
| Compute specificity of the ComplexSelector, see https://www.w3.org/TR/selectors-4/#specificity-rules. | |
| template<ElementLike T> | |
| SelectorMatchResult | matches (const T &targetElement, const SelectorMatchOptions< T > &options) const |
| Match a selector against an element, following the rules in the spec: https://www.w3.org/TR/selectors-4/#match-against-element. | |
Public Attributes | |
| std::vector< Entry > | entries |
| The entries in the complex selector. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const ComplexSelector &obj) |
| Ostream output operator for ComplexSelector, outputs debug strings e.g. "ComplexSelector(CompoundSelector(TypeSelector(name)))". | |
A complex selector is a sequence of one or more compound selectors, separated by combinators.
For example, div > #foo is a complex selector, with two compound selectors separated by a Combinator::Child.
| struct donner::css::ComplexSelector::Entry |
A single entry in a complex selector, which is a compound selector and a combinator.
| Class Members | ||
|---|---|---|
| Combinator | combinator | The combinator between this compound selector and the next. For regular selector lists, the first entry is set to Combinator::Descendant but it has no effect. For relative selector lists, the first entry is the leading combinator, for example "> div". |
| CompoundSelector | compoundSelector | The compound selector. |
| bool donner::css::ComplexSelector::isValid | ( | ) | const |
Return true if this selector is valid and supported by this implementation.
|
inline |
Match a selector against an element, following the rules in the spec: https://www.w3.org/TR/selectors-4/#match-against-element.
| T | A type that fulfills the ElementLike concept, to enable traversing the tree to match the selector. |
| targetElement | Element to match against. |
| options | Options to control matching. |