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 StylistThe CSS selector stylist.
visited_styles_enabled: boolWhether 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: StyleSystemOptionsConfiguration options.
guards: StylesheetGuards<'a>Guards for pre-acquired locks
current_time_for_animations: f64The 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: TraversalFlagsFlags controlling how we traverse the tree.
snapshot_map: &'a SnapshotMapA map with our snapshots in order to handle restyle hints.
animations: DocumentAnimationSetThe state of all animations for our styled elements.
registered_speculative_painters: &'a dyn RegisteredSpeculativePaintersPaint 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