Struct style::context::SharedStyleContext [] [src]

pub struct SharedStyleContext<'a> {
    pub stylist: &'a Stylist,
    pub visited_styles_enabled: bool,
    pub options: StyleSystemOptions,
    pub guards: StylesheetGuards<'a>,
    pub timer: Timer,
    pub traversal_flags: TraversalFlags,
    pub snapshot_map: &'a SnapshotMap,
    pub running_animations: Arc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>,
    pub expired_animations: Arc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>,
    pub registered_speculative_painters: &'a RegisteredSpeculativePainters,
    pub local_context_creation_data: Mutex<ThreadLocalStyleContextCreationInfo>,
}

A shared style context.

There's exactly one of these during a given restyle traversal, and it's shared among the worker threads.

Fields

The CSS selector stylist.

Whether visited styles are enabled.

They may be disabled when Gecko's pref layout.css.visited_links_enabled is false, or when in private browsing mode.

Configuration options.

Guards for pre-acquired locks

The current timer for transitions and animations. This is needed to test them.

Flags controlling how we traverse the tree.

A map with our snapshots in order to handle restyle hints.

The animations that are currently running.

The list of animations that have expired since the last style recalculation.

Paint worklets

Data needed to create the thread-local style context from the shared one.

Methods

impl<'a> SharedStyleContext<'a>
[src]

[src]

Return a suitable viewport size in order to be used for viewport units.

[src]

The device pixel ratio

[src]

The quirks mode of the document.