Struct style::context::ThreadLocalStyleContext
[−]
[src]
pub struct ThreadLocalStyleContext<E: TElement> { pub sharing_cache: StyleSharingCache<E>, pub rule_cache: RuleCache, pub bloom_filter: StyleBloom<E>, pub new_animations_sender: Sender<Animation>, pub tasks: SequentialTaskList<E>, pub selector_flags: SelectorFlagsMap<E>, pub statistics: TraversalStatistics, pub font_metrics_provider: E::FontMetricsProvider, pub stack_limit_checker: StackLimitChecker, pub nth_index_cache: NthIndexCache, }
A thread-local style context.
This context contains data that needs to be used during restyling, but is not required to be unique among worker threads, so we create one per worker thread in order to be able to mutate it without locking.
Fields
A cache to share style among siblings.
rule_cache: RuleCache
A cache from matched properties to elements that match those.
bloom_filter: StyleBloom<E>
The bloom filter used to fast-reject selector-matching.
new_animations_sender: Sender<Animation>
A channel on which new animations that have been triggered by style recalculation can be sent.
tasks: SequentialTaskList<E>
A set of tasks to be run (on the parent thread) in sequential mode after the rest of the styling is complete. This is useful for infrequently-needed non-threadsafe operations.
It's important that goes after the style sharing cache and the bloom filter, to ensure they're dropped before we execute the tasks, which could create another ThreadLocalStyleContext for style computation.
selector_flags: SelectorFlagsMap<E>
ElementSelectorFlags that need to be applied after the traversal is complete. This map is used in cases where the matching algorithm needs to set flags on elements it doesn't have exclusive access to (i.e. other than the current element).
statistics: TraversalStatistics
Statistics about the traversal.
font_metrics_provider: E::FontMetricsProvider
The struct used to compute and cache font metrics from style for evaluation of the font-relative em/ch units and font-size
stack_limit_checker: StackLimitChecker
A checker used to ensure that parallel.rs does not recurse indefinitely even on arbitrarily deep trees. See Gecko bug 1376883.
nth_index_cache: NthIndexCache
A cache for nth-index-like selectors.
Methods
impl<E: TElement> ThreadLocalStyleContext<E>
[src]
pub fn new(shared: &SharedStyleContext) -> Self
[src]
Creates a new ThreadLocalStyleContext
from a shared one.