pub struct KeyframeCustomPropertiesBuilder<'a> {
cascade: Cascade<'a>,
decls: Declarations<'a>,
shorthand_cache: ShorthandsWithPropertyReferencesCache,
}Expand description
Resolves the custom properties for a single @keyframes keyframe, layered on top of the base
style’s already-computed custom properties.
@keyframes aren’t part of the regular cascade (see bug 1883255), so this lets the caller seed
the substitution map with the element’s computed custom properties, cascade the keyframe’s
custom declarations on top, and resolve them (running cycle detection and substitution) into
context.builder.substitution_functions, which the subsequent animation-value computation reads
to substitute var() references.
Fields§
§cascade: Cascade<'a>§decls: Declarations<'a>§shorthand_cache: ShorthandsWithPropertyReferencesCacheImplementations§
Source§impl<'a> KeyframeCustomPropertiesBuilder<'a>
impl<'a> KeyframeCustomPropertiesBuilder<'a>
Sourcepub fn new(
stylist: &'a Stylist,
context: &mut Context<'_>,
base: ComputedCustomProperties,
) -> Self
pub fn new( stylist: &'a Stylist, context: &mut Context<'_>, base: ComputedCustomProperties, ) -> Self
Creates a new builder, seeding the substitution map with base (typically the element’s
computed custom properties).
Sourcepub fn cascade(
&mut self,
context: &mut Context<'_>,
declaration: &'a CustomDeclaration,
priority: CascadePriority,
)
pub fn cascade( &mut self, context: &mut Context<'_>, declaration: &'a CustomDeclaration, priority: CascadePriority, )
Cascades a single custom-property declaration from the keyframe.
Sourcepub fn build(
self,
context: &mut Context<'_>,
attribute_tracker: &mut AttributeTracker<'_>,
)
pub fn build( self, context: &mut Context<'_>, attribute_tracker: &mut AttributeTracker<'_>, )
Resolves the cascaded custom properties into context.builder.substitution_functions.
Auto Trait Implementations§
impl<'a> Freeze for KeyframeCustomPropertiesBuilder<'a>
impl<'a> !RefUnwindSafe for KeyframeCustomPropertiesBuilder<'a>
impl<'a> Send for KeyframeCustomPropertiesBuilder<'a>
impl<'a> Sync for KeyframeCustomPropertiesBuilder<'a>
impl<'a> Unpin for KeyframeCustomPropertiesBuilder<'a>
impl<'a> UnsafeUnpin for KeyframeCustomPropertiesBuilder<'a>
impl<'a> !UnwindSafe for KeyframeCustomPropertiesBuilder<'a>
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
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>
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>
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 more