Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::PseudoElementSelector Struct Reference

Selectors which start with two colons are called pseudo-elements, e.g. More...

#include "donner/css/selectors/PseudoElementSelector.h"

Collaboration diagram for donner::css::PseudoElementSelector:
[legend]

Public Member Functions

 PseudoElementSelector (const RcString &ident)
 Create a PseudoElementSelector with the given identifier.
 
 ~PseudoElementSelector () noexcept=default
 Destructor.
 
 PseudoElementSelector (PseudoElementSelector &&)=default
 Move constructor.
 
PseudoElementSelectoroperator= (PseudoElementSelector &&)=default
 Move assignment operator.
 
 PseudoElementSelector (const PseudoElementSelector &)=default
 Copy constructor.
 
PseudoElementSelectoroperator= (const PseudoElementSelector &)=default
 Copy assignment operator.
 
bool isValid () const
 Returns true if this selector is valid and supported by this implementation.
 
template<ElementLike T>
bool matches (const T &element) const
 Returns true if the provided element matches this selector.
 

Public Attributes

RcString ident
 The identifier of the pseudo-element.
 
std::optional< std::vector< ComponentValue > > argsIfFunction
 The arguments to the function, if this is a function.
 

Friends

std::ostream & operator<< (std::ostream &os, const PseudoElementSelector &obj)
 Ostream output operator for PseudoElementSelector, outputs a debug string e.g. PseudoElementSelector(first-line).
 

Detailed Description

Selectors which start with two colons are called pseudo-elements, e.g.

'::before'. They are used to represent elements which are not directly present in the document tree.

See https://www.w3.org/TR/selectors-4/#pseudo-elements for the full definition.

Pseudo-elements are listed in the CSS Pseudo-Elements Module Level 4 spec: https://www.w3.org/TR/css-pseudo-4/

For SVG, there are no supported pseudo-elements, however pseudo-classes are supported.

Constructor & Destructor Documentation

◆ PseudoElementSelector()

donner::css::PseudoElementSelector::PseudoElementSelector ( const RcString & ident)
inlineexplicit

Create a PseudoElementSelector with the given identifier.

Parameters
identThe identifier of the pseudo-element.

Member Function Documentation

◆ isValid()

bool donner::css::PseudoElementSelector::isValid ( ) const
inline

Returns true if this selector is valid and supported by this implementation.

This is always false for donner.

See also
https://www.w3.org/TR/selectors-4/#invalid

◆ matches()

template<ElementLike T>
bool donner::css::PseudoElementSelector::matches ( const T & element) const
inline

Returns true if the provided element matches this selector.

This is always false for donner.

Parameters
elementThe element to check.

The documentation for this struct was generated from the following file: