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

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

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.

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

Updates an empty stylesheet from a given string of text.

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.

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

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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Get the stylesheet origin.
Get the stylesheet quirks mode.
Get the media associated with this stylesheet.
Get whether this stylesheet is enabled.
Returns a reference to the list of rules in this stylesheet.
Return an iterator using the condition C.
Returns whether the style-sheet applies for the current device.
Return an iterator over the effective rules within the style-sheet, as according to the supplied Device. Read more
Get a MediaListKey for this item. This key needs to uniquely identify the item. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert
Convert
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more