/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Generic values for properties related to animations and transitions.
usecrate::values::generics::length::GenericLengthPercentageOrAuto; usecrate::values::specified::animation::{ScrollAxis, ScrollFunction, TimelineName}; usecrate::Zero; use std::fmt::{self, Write}; use style_traits::{CssWriter, ToCss};
/// The `animation-duration` property. /// /// https://drafts.csswg.org/css-animations-2/#animation-duration #[derive(
Clone,
Copy,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToShmem,
)] #[repr(C, u8)] pubenum GenericAnimationDuration<T> { /// The initial value. However, we serialize this as 0s if the preference is disabled.
Auto, /// The time value, <time [0s,∞]>.
Time(T),
}
pubuseself::GenericAnimationDuration as AnimationDuration;
/// Returns true if it is auto (i.e. the default value). pubfn is_auto(&self) -> bool {
matches!(self, Self::Auto)
}
}
/// A generic value for the `[ [ auto | <length-percentage> ]{1,2} ]`. /// /// https://drafts.csswg.org/scroll-animations-1/#view-timeline-inset #[derive(
Clone,
Copy,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] #[repr(C)] pubstruct GenericViewTimelineInset<LengthPercent> { /// The start inset in the relevant axis. pub start: GenericLengthPercentageOrAuto<LengthPercent>, /// The end inset. pub end: GenericLengthPercentageOrAuto<LengthPercent>,
}
pubuseself::GenericViewTimelineInset as ViewTimelineInset;
impl<LengthPercent> ViewTimelineInset<LengthPercent> { /// Returns true if it is auto. #[inline] fn is_auto(&self) -> bool { self.start.is_auto() && self.end.is_auto()
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.