Struct style::stylesheet_set::DocumentStylesheetSet
source · [−]pub struct DocumentStylesheetSet<S> where
S: StylesheetInDocument + PartialEq + 'static, {
collections: PerOrigin<SheetCollection<S>>,
invalidations: StylesheetInvalidationSet,
}
Expand description
The set of stylesheets effective for a given document.
Fields
collections: PerOrigin<SheetCollection<S>>
The collections of sheets per each origin.
invalidations: StylesheetInvalidationSet
The invalidations for stylesheets added or removed from this document.
Implementations
sourceimpl<S> DocumentStylesheetSet<S> where
S: StylesheetInDocument + PartialEq + 'static,
impl<S> DocumentStylesheetSet<S> where
S: StylesheetInDocument + PartialEq + 'static,
fn collection_for(
&mut self,
sheet: &S,
guard: &SharedRwLockReadGuard<'_>
) -> &mut SheetCollection<S>
fn collect_invalidations_for(
&mut self,
device: Option<&Device>,
sheet: &S,
guard: &SharedRwLockReadGuard<'_>
)
sourcepub fn append_stylesheet(
&mut self,
device: Option<&Device>,
sheet: S,
guard: &SharedRwLockReadGuard<'_>
)
pub fn append_stylesheet(
&mut self,
device: Option<&Device>,
sheet: S,
guard: &SharedRwLockReadGuard<'_>
)
Appends a new stylesheet to the current set.
No device implies not computing invalidations.
sourcepub fn insert_stylesheet_before(
&mut self,
device: Option<&Device>,
sheet: S,
before_sheet: S,
guard: &SharedRwLockReadGuard<'_>
)
pub fn insert_stylesheet_before(
&mut self,
device: Option<&Device>,
sheet: S,
before_sheet: S,
guard: &SharedRwLockReadGuard<'_>
)
Insert a given stylesheet before another stylesheet in the document.
sourcepub fn remove_stylesheet(
&mut self,
device: Option<&Device>,
sheet: S,
guard: &SharedRwLockReadGuard<'_>
)
pub fn remove_stylesheet(
&mut self,
device: Option<&Device>,
sheet: S,
guard: &SharedRwLockReadGuard<'_>
)
Remove a given stylesheet from the set.
sourcepub fn rule_changed(
&mut self,
device: Option<&Device>,
sheet: &S,
rule: &CssRule,
guard: &SharedRwLockReadGuard<'_>,
change_kind: RuleChangeKind
)
pub fn rule_changed(
&mut self,
device: Option<&Device>,
sheet: &S,
rule: &CssRule,
guard: &SharedRwLockReadGuard<'_>,
change_kind: RuleChangeKind
)
Notify the set that a rule from a given stylesheet has changed somehow.
sourcepub fn sheet_count(&self, origin: Origin) -> usize
pub fn sheet_count(&self, origin: Origin) -> usize
Returns the count of stylesheets for a given origin.
sourcepub fn get(&self, origin: Origin, index: usize) -> Option<&S>
pub fn get(&self, origin: Origin, index: usize) -> Option<&S>
Returns the index
th stylesheet in the set for the given origin.
sourcepub fn has_changed(&self) -> bool
pub fn has_changed(&self) -> bool
Returns whether the given set has changed from the last flush.
sourcepub fn flush<E>(
&mut self,
document_element: Option<E>,
snapshots: Option<&SnapshotMap>
) -> DocumentStylesheetFlusher<'_, S> where
E: TElement,
pub fn flush<E>(
&mut self,
document_element: Option<E>,
snapshots: Option<&SnapshotMap>
) -> DocumentStylesheetFlusher<'_, S> where
E: TElement,
Flush the current set, unmarking it as dirty, and returns a
DocumentStylesheetFlusher
in order to rebuild the stylist.
sourcepub fn flush_without_invalidation(&mut self) -> OriginSet
pub fn flush_without_invalidation(&mut self) -> OriginSet
Flush stylesheets, but without running any of the invalidation passes.
sourcepub fn iter(&self) -> StylesheetIterator<'_, S>ⓘNotable traits for StylesheetIterator<'a, S>impl<'a, S> Iterator for StylesheetIterator<'a, S> where
S: StylesheetInDocument + PartialEq + 'static, type Item = (&'a S, Origin);
pub fn iter(&self) -> StylesheetIterator<'_, S>ⓘNotable traits for StylesheetIterator<'a, S>impl<'a, S> Iterator for StylesheetIterator<'a, S> where
S: StylesheetInDocument + PartialEq + 'static, type Item = (&'a S, Origin);
S: StylesheetInDocument + PartialEq + 'static, type Item = (&'a S, Origin);
Return an iterator over the flattened view of all the stylesheets.
sourcepub fn force_dirty(&mut self, origins: OriginSet)
pub fn force_dirty(&mut self, origins: OriginSet)
Mark the stylesheets for the specified origin as dirty, because something external may have invalidated it.
Trait Implementations
sourceimpl<S> MallocSizeOf for DocumentStylesheetSet<S> where
S: StylesheetInDocument + PartialEq + 'static,
S: MallocSizeOf,
impl<S> MallocSizeOf for DocumentStylesheetSet<S> where
S: StylesheetInDocument + PartialEq + 'static,
S: MallocSizeOf,
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for DocumentStylesheetSet<S> where
S: RefUnwindSafe,
impl<S> Send for DocumentStylesheetSet<S> where
S: Send,
impl<S> Sync for DocumentStylesheetSet<S> where
S: Sync,
impl<S> Unpin for DocumentStylesheetSet<S> where
S: Unpin,
impl<S> UnwindSafe for DocumentStylesheetSet<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
sourcefn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
sourceimpl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
sourcefn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more