Parse a CSS selector.
In CSS, a selector is used to identify which element or elements in a DOM are being selected for the application of a particular style. Effectively, selectors function as a query language for a structured document -- almost always HTML or XML.
This class provides an event-based parser for CSS selectors. It can be used, for example, as a basis for writing a DOM query engine based on CSS.
__construct( $string, \QueryPath\CSS\EventHandler $handler)
Construct a new CSS parser object. This will attempt to parse the string as a CSS selector. As it parses, it will send events to the EventHandler implementation.
pseudoClass( $restricted = FALSE)
Handle a pseudo-class and pseudo-element.
CSS 3 selectors support separate pseudo-elements, using :: instead of : for separator. This is now supported, and calls the pseudoElement handler, EventHandler::pseudoElement().
This will call EventHandler::pseudoClass() when a pseudo-class is parsed.