pub struct StylesheetInvalidationSet {
pub cascade_data_difference: CascadeDataDifference,
/* private fields */
}Expand description
A set of invalidations due to stylesheet changes.
TODO(emilio): We might be able to do the same analysis for media query changes too (or even selector changes?) specially now that we take the cascade data difference into account.
Fields§
§cascade_data_difference: CascadeDataDifferenceThe difference between the old and new cascade data, incrementally collected until flush() returns it.
Implementations§
Source§impl StylesheetInvalidationSet
impl StylesheetInvalidationSet
Sourcepub fn invalidate_fully(&mut self)
pub fn invalidate_fully(&mut self)
Mark the DOM tree styles’ as fully invalid.
Sourcepub fn collect_invalidations_for<S>(
&mut self,
device: &Device,
custom_media: &CustomMediaMap,
stylesheet: &S,
guard: &SharedRwLockReadGuard<'_>,
)where
S: StylesheetInDocument,
pub fn collect_invalidations_for<S>(
&mut self,
device: &Device,
custom_media: &CustomMediaMap,
stylesheet: &S,
guard: &SharedRwLockReadGuard<'_>,
)where
S: StylesheetInDocument,
Analyze the given stylesheet, and collect invalidations from their rules, in order to avoid doing a full restyle when we style the document next time.
Sourcepub fn process_style<E>(&self, root: E, snapshots: Option<&SnapshotMap>) -> boolwhere
E: TElement,
pub fn process_style<E>(&self, root: E, snapshots: Option<&SnapshotMap>) -> boolwhere
E: TElement,
Processes the style invalidation set, invalidating elements as needed. Returns true if any style invalidations occurred.
Sourcepub fn rule_changed<S>(
&mut self,
stylesheet: &S,
rule: &CssRule,
guard: &SharedRwLockReadGuard<'_>,
device: &Device,
quirks_mode: QuirksMode,
custom_media: &CustomMediaMap,
change_kind: RuleChangeKind,
ancestors: &[CssRuleRef<'_>],
)where
S: StylesheetInDocument,
pub fn rule_changed<S>(
&mut self,
stylesheet: &S,
rule: &CssRule,
guard: &SharedRwLockReadGuard<'_>,
device: &Device,
quirks_mode: QuirksMode,
custom_media: &CustomMediaMap,
change_kind: RuleChangeKind,
ancestors: &[CssRuleRef<'_>],
)where
S: StylesheetInDocument,
Collects invalidations for a given CSS rule, if not fully invalid already.
Trait Implementations§
Source§impl Debug for StylesheetInvalidationSet
impl Debug for StylesheetInvalidationSet
Source§impl Default for StylesheetInvalidationSet
impl Default for StylesheetInvalidationSet
Source§fn default() -> StylesheetInvalidationSet
fn default() -> StylesheetInvalidationSet
Returns the “default value” for a type. Read more
Source§impl MallocSizeOf for StylesheetInvalidationSet
impl MallocSizeOf for StylesheetInvalidationSet
Source§fn 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.
Auto Trait Implementations§
impl Freeze for StylesheetInvalidationSet
impl RefUnwindSafe for StylesheetInvalidationSet
impl Send for StylesheetInvalidationSet
impl Sync for StylesheetInvalidationSet
impl Unpin for StylesheetInvalidationSet
impl UnsafeUnpin for StylesheetInvalidationSet
impl UnwindSafe for StylesheetInvalidationSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert