[−][src]Struct style::stylesheets::Stylesheet
The structure servo uses to represent a stylesheet.
Fields
contents: StylesheetContentsThe contents of this stylesheet.
The lock used for objects inside this stylesheet
media: Arc<Locked<MediaList>>List of media associated with the Stylesheet.
disabled: AtomicBoolWhether 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]
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
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]
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>
)
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]
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
)
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]
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>)
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]
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
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]
fn clone(&self) -> Self[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for Stylesheet[src]
impl StylesheetInDocument for Stylesheet[src]
fn origin(&self, _guard: &SharedRwLockReadGuard) -> Origin[src]
fn quirks_mode(&self, _guard: &SharedRwLockReadGuard) -> QuirksMode[src]
fn media<'a>(
&'a self,
guard: &'a SharedRwLockReadGuard
) -> Option<&'a MediaList>[src]
&'a self,
guard: &'a SharedRwLockReadGuard
) -> Option<&'a MediaList>
fn enabled(&self) -> bool[src]
fn rules<'a, 'b: 'a>(
&'a self,
guard: &'b SharedRwLockReadGuard
) -> &'a [CssRule]ⓘ[src]
&'a self,
guard: &'b SharedRwLockReadGuard
) -> &'a [CssRule]ⓘ
fn iter_rules<'a, 'b, C>(
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, C>ⓘImportant traits for RulesIterator<'a, 'b, C>
impl<'a, 'b, C> Iterator for RulesIterator<'a, 'b, C> where
'b: 'a,
C: NestedRuleIterationCondition + 'static, type Item = &'a CssRule; where
C: NestedRuleIterationCondition, [src]
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, C>ⓘ
Important traits for RulesIterator<'a, 'b, C>
impl<'a, 'b, C> Iterator for RulesIterator<'a, 'b, C> where
'b: 'a,
C: NestedRuleIterationCondition + 'static, type Item = &'a CssRule;C: NestedRuleIterationCondition,
fn is_effective_for_device(
&self,
device: &Device,
guard: &SharedRwLockReadGuard
) -> bool[src]
&self,
device: &Device,
guard: &SharedRwLockReadGuard
) -> bool
fn effective_rules<'a, 'b>(
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, EffectiveRules>ⓘImportant traits for RulesIterator<'a, 'b, C>
impl<'a, 'b, C> Iterator for RulesIterator<'a, 'b, C> where
'b: 'a,
C: NestedRuleIterationCondition + 'static, type Item = &'a CssRule;[src]
&'a self,
device: &'a Device,
guard: &'a SharedRwLockReadGuard<'b>
) -> RulesIterator<'a, 'b, EffectiveRules>ⓘ
Important traits for RulesIterator<'a, 'b, C>
impl<'a, 'b, C> Iterator for RulesIterator<'a, 'b, C> where
'b: 'a,
C: NestedRuleIterationCondition + 'static, type Item = &'a CssRule;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),
impl ToMediaListKey for Stylesheet[src]
fn to_media_list_key(&self) -> MediaListKey[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[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]
U: From<T>,
impl<T> MaybeBoxed<Box<T>> for T[src]
fn maybe_boxed(Self) -> Box<T>[src]
impl<T> MaybeBoxed<T> for T[src]
fn maybe_boxed(Self) -> 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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,