Struct style::context::SharedStyleContext
source · pub struct SharedStyleContext<'a> {
pub stylist: &'a Stylist,
pub visited_styles_enabled: bool,
pub options: StyleSystemOptions,
pub guards: StylesheetGuards<'a>,
pub current_time_for_animations: f64,
pub traversal_flags: TraversalFlags,
pub snapshot_map: &'a SnapshotMap,
pub animations: DocumentAnimationSet,
pub registered_speculative_painters: &'a dyn RegisteredSpeculativePainters,
}
Expand description
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
current_time_for_animations: f64
The current time for transitions and animations. This is needed to ensure a consistent sampling time and also to adjust the time for testing.
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.
animations: DocumentAnimationSet
The state of all animations for our styled elements.
registered_speculative_painters: &'a dyn RegisteredSpeculativePainters
Paint worklets
Implementations§
sourcepub fn viewport_size(&self) -> Size2D<Au>
pub fn viewport_size(&self) -> Size2D<Au>
Return a suitable viewport size in order to be used for viewport units.
sourcepub fn device_pixel_ratio(&self) -> Scale<f32, CSSPixel, DevicePixel>
pub fn device_pixel_ratio(&self) -> Scale<f32, CSSPixel, DevicePixel>
The device pixel ratio
sourcepub fn quirks_mode(&self) -> QuirksMode
pub fn quirks_mode(&self) -> QuirksMode
The quirks mode of the document.
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more