StylesheetInDocument

Trait StylesheetInDocument 

Source
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§

Source

fn enabled(&self) -> bool

Get whether this stylesheet is enabled.

Source

fn media<'a>( &'a self, guard: &'a SharedRwLockReadGuard<'_>, ) -> Option<&'a MediaList>

Get the media associated with this stylesheet.

Source

fn contents<'a>( &'a self, guard: &'a SharedRwLockReadGuard<'_>, ) -> &'a StylesheetContents

Returns a reference to the contents of the stylesheet.

Source

fn implicit_scope_root(&self) -> Option<ImplicitScopeRoot>

Return the implicit scope root for this stylesheet, if one exists.

Provided Methods§

Source

fn is_effective_for_device( &self, device: &Device, guard: &SharedRwLockReadGuard<'_>, ) -> bool

Returns whether the style-sheet applies for the current device.

Implementors§