Struct style::stylesheets::Stylesheet
[−]
[src]
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.
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.
Methods
impl Stylesheet
[src]
pub fn from_bytes<R>(
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<&StylesheetLoader>,
error_reporter: &R,
quirks_mode: QuirksMode
) -> Stylesheet where
R: ParseErrorReporter,
[src]
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<&StylesheetLoader>,
error_reporter: &R,
quirks_mode: QuirksMode
) -> Stylesheet where
R: ParseErrorReporter,
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<R>(
existing: &Stylesheet,
bytes: &[u8],
protocol_encoding_label: Option<&str>,
environment_encoding: Option<&'static Encoding>,
url_data: UrlExtraData,
stylesheet_loader: Option<&StylesheetLoader>,
error_reporter: &R
) where
R: ParseErrorReporter,
[src]
existing: &Stylesheet,
bytes: &[u8],
protocol_encoding_label: Option<&str>,
environment_encoding: Option<&'static Encoding>,
url_data: UrlExtraData,
stylesheet_loader: Option<&StylesheetLoader>,
error_reporter: &R
) where
R: ParseErrorReporter,
Updates an empty stylesheet with a set of bytes that reached over the network.
impl Stylesheet
[src]
pub fn update_from_str<R>(
existing: &Stylesheet,
css: &str,
url_data: UrlExtraData,
stylesheet_loader: Option<&StylesheetLoader>,
error_reporter: &R,
line_number_offset: u32
) where
R: ParseErrorReporter,
[src]
existing: &Stylesheet,
css: &str,
url_data: UrlExtraData,
stylesheet_loader: Option<&StylesheetLoader>,
error_reporter: &R,
line_number_offset: u32
) where
R: ParseErrorReporter,
Updates an empty stylesheet from a given string of text.
pub fn from_str<R: ParseErrorReporter>(
css: &str,
url_data: UrlExtraData,
origin: Origin,
media: Arc<Locked<MediaList>>,
shared_lock: SharedRwLock,
stylesheet_loader: Option<&StylesheetLoader>,
error_reporter: &R,
quirks_mode: QuirksMode,
line_number_offset: u32
) -> Stylesheet
[src]
css: &str,
url_data: UrlExtraData,
origin: Origin,
media: Arc<Locked<MediaList>>,
shared_lock: SharedRwLock,
stylesheet_loader: Option<&StylesheetLoader>,
error_reporter: &R,
quirks_mode: QuirksMode,
line_number_offset: u32
) -> Stylesheet
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 ToMediaListKey for Stylesheet
[src]
fn to_media_list_key(&self) -> MediaListKey
[src]
Get a MediaListKey
for this item. This key needs to uniquely identify the item. Read more
impl Debug for Stylesheet
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl StylesheetInDocument for Stylesheet
[src]
fn contents(&self, _: &SharedRwLockReadGuard) -> &StylesheetContents
[src]
Get the contents of this stylesheet.
fn media<'a>(
&'a self,
guard: &'a SharedRwLockReadGuard
) -> Option<&'a MediaList>
[src]
&'a self,
guard: &'a SharedRwLockReadGuard
) -> Option<&'a MediaList>
Get the media associated with this stylesheet.
fn enabled(&self) -> bool
[src]
Get whether this stylesheet is enabled.
fn origin(&self, guard: &SharedRwLockReadGuard) -> Origin
[src]
Get the stylesheet origin.
fn quirks_mode(&self, guard: &SharedRwLockReadGuard) -> QuirksMode
[src]
Get the stylesheet quirks mode.
fn is_effective_for_device(
&self,
device: &Device,
guard: &SharedRwLockReadGuard
) -> bool
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard
) -> bool
Returns whether the style-sheet applies for the current device.
ⓘImportant traits for RulesIterator<'a, 'b, C>fn iter_rules<'a, 'b, C>(
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, C> where
C: NestedRuleIterationCondition,
[src]
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, C> where
C: NestedRuleIterationCondition,
Return an iterator using the condition C
.
ⓘImportant traits for RulesIterator<'a, 'b, C>fn effective_rules<'a, 'b>(
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, EffectiveRules>
[src]
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, EffectiveRules>
Return an iterator over the effective rules within the style-sheet, as according to the supplied Device
. Read more
fn effective_style_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&StyleRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&StyleRule),
fn effective_media_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&MediaRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&MediaRule),
fn effective_font_face_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&FontFaceRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&FontFaceRule),
fn effective_font_face_feature_values_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&FontFeatureValuesRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&FontFeatureValuesRule),
fn effective_counter_style_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&CounterStyleRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&CounterStyleRule),
fn effective_viewport_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&ViewportRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&ViewportRule),
fn effective_keyframes_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&KeyframesRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&KeyframesRule),
fn effective_supports_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&SupportsRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&SupportsRule),
fn effective_page_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&PageRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&PageRule),
fn effective_document_rules<F>(
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&DocumentRule),
[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard,
f: F
) where
F: FnMut(&DocumentRule),