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
stylist: &'a Stylist
The CSS selector stylist.
visited_styles_enabled: bool
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.
options: StyleSystemOptions
Configuration options.
guards: StylesheetGuards<'a>
Guards for pre-acquired locks
timer: Timer
The current timer for transitions and animations. This is needed to test them.
traversal_flags: TraversalFlags
Flags controlling how we traverse the tree.
snapshot_map: &'a SnapshotMap
A map with our snapshots in order to handle restyle hints.
running_animations: Arc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>
The animations that are currently running.
expired_animations: Arc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>
The list of animations that have expired since the last style recalculation.
registered_speculative_painters: &'a RegisteredSpeculativePainters
Paint worklets
local_context_creation_data: Mutex<ThreadLocalStyleContextCreationInfo>
Data needed to create the thread-local style context from the shared one.
Methods
impl<'a> SharedStyleContext<'a>
[src]
pub fn viewport_size(&self) -> Size2D<Au>
[src]
Return a suitable viewport size in order to be used for viewport units.
pub fn device_pixel_ratio(&self) -> TypedScale<f32, CSSPixel, DevicePixel>
[src]
The device pixel ratio
pub fn quirks_mode(&self) -> QuirksMode
[src]
The quirks mode of the document.