|
|
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 compound selector is a sequence of simple selectors, which represents a set of conditions that are combined to match a single element. More...
#include "donner/css/selectors/CompoundSelector.h"
Public Types | |
| using | Entry |
| A single entry in a compound selector, which can be any of the simple selectors in this variant. | |
Public Member Functions | |
| CompoundSelector ()=default | |
| Default constructor. | |
| ~CompoundSelector () noexcept=default | |
| Destructor. | |
| CompoundSelector (const CompoundSelector &)=default | |
| Copy constructor. | |
| CompoundSelector (CompoundSelector &&)=default | |
| Move constructor. | |
| CompoundSelector & | operator= (const CompoundSelector &)=default |
| Copy assignment operator. | |
| CompoundSelector & | operator= (CompoundSelector &&)=default |
| Move assignment operator. | |
| bool | isValid () const |
| Return true if this selector is valid and supported by this implementation. | |
| template<ElementLike T> | |
| bool | matches (const T &element, bool requirePrimary, const SelectorMatchOptions< T > &options) const |
| Returns true if the provided element matches this selector. | |
Public Attributes | |
| std::vector< Entry > | entries |
| The list of simple selectors in this compound selector. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const CompoundSelector &obj) |
| Ostream output operator, outputs a debug string, e.g. CompoundSelector(TypeSelector(name)). | |
A compound selector is a sequence of simple selectors, which represents a set of conditions that are combined to match a single element.
For example, the selector div#foo.bar is a compound selector, while div > #foo is two compound selectors separated by a combinator. Combinators are handled as part of ComplexSelector.
A single entry in a compound selector, which can be any of the simple selectors in this variant.
|
inline |
Return true if this selector is valid and supported by this implementation.
|
inline |
Returns true if the provided element matches this selector.
| T | A type that fulfills the ElementLike concept, to enable traversing the tree to match the selector. |
| element | The element to check. |
| requirePrimary | If true, only primary selectors are considered. |
| options | Options to control matching. |