pub trait StylesheetInDocument: Debug {
// Required methods
fn enabled(&self) -> bool;
fn media<'a>(
&'a self,
guard: &'a SharedRwLockReadGuard<'_>,
) -> Option<&'a MediaList>;
fn contents<'a>(
&'a self,
guard: &'a SharedRwLockReadGuard<'_>,
) -> &'a StylesheetContents;
fn implicit_scope_root(&self) -> Option<ImplicitScopeRoot>;
// Provided method
fn is_effective_for_device(
&self,
device: &Device,
guard: &SharedRwLockReadGuard<'_>,
) -> bool { ... }
}Expand description
A trait to represent a given stylesheet in a document.
Required Methods§
Sourcefn media<'a>(
&'a self,
guard: &'a SharedRwLockReadGuard<'_>,
) -> Option<&'a MediaList>
fn media<'a>( &'a self, guard: &'a SharedRwLockReadGuard<'_>, ) -> Option<&'a MediaList>
Get the media associated with this stylesheet.
Sourcefn contents<'a>(
&'a self,
guard: &'a SharedRwLockReadGuard<'_>,
) -> &'a StylesheetContents
fn contents<'a>( &'a self, guard: &'a SharedRwLockReadGuard<'_>, ) -> &'a StylesheetContents
Returns a reference to the contents of the stylesheet.
Sourcefn implicit_scope_root(&self) -> Option<ImplicitScopeRoot>
fn implicit_scope_root(&self) -> Option<ImplicitScopeRoot>
Return the implicit scope root for this stylesheet, if one exists.
Provided Methods§
Sourcefn is_effective_for_device(
&self,
device: &Device,
guard: &SharedRwLockReadGuard<'_>,
) -> bool
fn is_effective_for_device( &self, device: &Device, guard: &SharedRwLockReadGuard<'_>, ) -> bool
Returns whether the style-sheet applies for the current device.