#![deny(missing_docs)]
use crate::attr::NamespaceConstraint;
use crate::parser::{Combinator, Component, Selector, SelectorImpl};
pub trait SelectorVisitor: Sized {
type Impl: SelectorImpl;
fn visit_attribute_selector(
&mut self,
_namespace: &NamespaceConstraint<&<Self::Impl as SelectorImpl>::NamespaceUrl>,
_local_name: &<Self::Impl as SelectorImpl>::LocalName,
_local_name_lower: &<Self::Impl as SelectorImpl>::LocalName,
) -> bool {
true
}
fn visit_simple_selector(&mut self, _: &Component<Self::Impl>) -> bool {
true
}
fn visit_selector_list(&mut self, list: &[Selector<Self::Impl>]) -> bool {
for nested in list {
if !nested.visit(self) {
return false;
}
}
true
}
fn visit_complex_selector(&mut self, _combinator_to_right: Option<Combinator>) -> bool {
true
}
}