[][src]Struct style::stylesheets::Stylesheet

pub struct Stylesheet {
    pub contents: StylesheetContents,
    pub shared_lock: SharedRwLock,
    pub media: Arc<Locked<MediaList>>,
    pub disabled: AtomicBool,
}

The structure servo uses to represent a stylesheet.

Fields

contents: StylesheetContents

The contents of this stylesheet.

shared_lock: SharedRwLock

The lock used for objects inside this stylesheet

media: Arc<Locked<MediaList>>

List of media associated with the Stylesheet.

disabled: AtomicBool

Whether this stylesheet should be disabled.

Implementations

impl Stylesheet[src]

pub fn from_bytes(
    bytes: &[u8],
    url_data: UrlExtraData,
    protocol_encoding_label: Option<&str>,
    environment_encoding: Option<&'static Encoding>,
    origin: Origin,
    media: MediaList,
    shared_lock: SharedRwLock,
    stylesheet_loader: Option<&dyn StylesheetLoader>,
    error_reporter: Option<&dyn ParseErrorReporter>,
    quirks_mode: QuirksMode
) -> Stylesheet
[src]

Parse a stylesheet from a set of bytes, potentially received over the network.

Takes care of decoding the network bytes and forwards the resulting string to Stylesheet::from_str.

pub fn update_from_bytes(
    existing: &Stylesheet,
    bytes: &[u8],
    protocol_encoding_label: Option<&str>,
    environment_encoding: Option<&'static Encoding>,
    url_data: UrlExtraData,
    stylesheet_loader: Option<&dyn StylesheetLoader>,
    error_reporter: Option<&dyn ParseErrorReporter>
)
[src]

Updates an empty stylesheet with a set of bytes that reached over the network.

impl Stylesheet[src]

pub fn update_from_str(
    existing: &Stylesheet,
    css: &str,
    url_data: UrlExtraData,
    stylesheet_loader: Option<&dyn StylesheetLoader>,
    error_reporter: Option<&dyn ParseErrorReporter>,
    line_number_offset: u32,
    allow_import_rules: AllowImportRules
)
[src]

Updates an empty stylesheet from a given string of text.

fn parse_rules(
    css: &str,
    url_data: &UrlExtraData,
    origin: Origin,
    namespaces: &mut Namespaces,
    shared_lock: &SharedRwLock,
    stylesheet_loader: Option<&dyn StylesheetLoader>,
    error_reporter: Option<&dyn ParseErrorReporter>,
    quirks_mode: QuirksMode,
    line_number_offset: u32,
    use_counters: Option<&UseCounters>,
    allow_import_rules: AllowImportRules,
    sanitization_data: Option<&mut SanitizationData>
) -> (Vec<CssRule>, Option<String>, Option<String>)
[src]

pub fn from_str(
    css: &str,
    url_data: UrlExtraData,
    origin: Origin,
    media: Arc<Locked<MediaList>>,
    shared_lock: SharedRwLock,
    stylesheet_loader: Option<&dyn StylesheetLoader>,
    error_reporter: Option<&dyn ParseErrorReporter>,
    quirks_mode: QuirksMode,
    line_number_offset: u32,
    allow_import_rules: AllowImportRules
) -> Self
[src]

Creates an empty stylesheet and parses it with a given base url, origin and media.

Effectively creates a new stylesheet and forwards the hard work to Stylesheet::update_from_str.

pub fn disabled(&self) -> bool[src]

Returns whether the stylesheet has been explicitly disabled through the CSSOM.

pub fn set_disabled(&self, disabled: bool) -> bool[src]

Records that the stylesheet has been explicitly disabled through the CSSOM.

Returns whether the the call resulted in a change in disabled state.

Disabled stylesheets remain in the document, but their rules are not added to the Stylist.

Trait Implementations

impl Clone for Stylesheet[src]

impl Debug for Stylesheet[src]

impl StylesheetInDocument for Stylesheet[src]

impl ToMediaListKey for Stylesheet[src]

Auto Trait Implementations

impl !RefUnwindSafe for Stylesheet

impl Send for Stylesheet

impl Sync for Stylesheet

impl Unpin for Stylesheet

impl !UnwindSafe for Stylesheet

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeBoxed<Box<T>> for T[src]

impl<T> MaybeBoxed<T> for T[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]