muskitty_selectors/lib.rs
1//! MusKitty Selectors — Selectors Level 4 parser & matcher.
2//!
3//! Implements the Selectors Level 4 specification (selector parsing,
4//! specificity calculation, and element matching) for the MusKitty
5//! browser engine.
6//!
7//! # Architecture
8//!
9//! - **Parsing** ([`parser`], [`types`]) — consumes a token stream
10//! produced by `muskitty-css::tokenize` and builds selector data
11//! structures (SelectorList / ComplexSelector / CompoundSelector /
12//! SubclassSelector / ...). No DOM dependency.
13//! - **Specificity** ([`specificity`]) — computes the A/B/C triplet per
14//! §17.
15//! - **Matching** ([`matching`]) — matches parsed selectors against an
16//! element tree via the [`matching::Element`] trait. A reference
17//! implementation for `muskitty-dom` is provided as a dev-only
18//! integration.
19//!
20//! # References
21//!
22//! - Selectors Level 4: <https://drafts.csswg.org/selectors-4/>
23//! - Spec source (Markdown): `D:\CSSWG\selectors-4\Overview.md`
24
25pub mod error;
26pub mod matching;
27pub mod parser;
28pub mod specificity;
29pub mod types;
30
31/// Convenience re-export of the [`Specificity`](specificity::Specificity)
32/// type for ergonomic access from downstream crates.
33pub use specificity::Specificity;
34
35/// Convenience re-exports of the matching engine's public API
36/// (§18 L4878-5026): [`matches`](matching::matches),
37/// [`query_selector`](matching::query_selector),
38/// [`query_selector_all`](matching::query_selector_all), and the
39/// [`Element`](matching::Element) trait.
40pub use matching::{matches, query_selector, query_selector_all, Element};