Skip to main content

Module compile

Module compile 

Source
Expand description

Compiled stylesheet for ~O(1) widget→style lookup.

CompiledStyleSheet pre-buckets rules from a StyleSheet by their primary selector part (type name, class name, or id) so that resolving a widget’s style only needs to examine the relevant subset of rules rather than the full rule list.

The cascade result is identical to StyleSheet::compute_style: specificity ordering, first-matching-selector semantics, and source-order tie-breaking are all preserved.

Structs§

CompiledStyleSheet
A compiled stylesheet: rules indexed into buckets keyed by their primary selector part so that widget→style resolution is ~O(1) for common cases.