Include animations and transitions in the cascade

Instead of applying animations and transitions to styled elements,
include them in the cascade. This allows them to interact properly with
things like font-size and !important rules.
This commit is contained in:
Martin Robinson 2020-05-20 15:44:17 +02:00
parent 8b56b7a3c2
commit 364235ac0c
17 changed files with 314 additions and 216 deletions

View file

@ -2828,11 +2828,12 @@ pub mod style_structs {
/// Returns whether there are any transitions specified.
#[cfg(feature = "servo")]
pub fn specifies_transitions(&self) -> bool {
// TODO(mrobinson): This should check the combined duration and not just
// the duration.
self.transition_duration_iter()
.take(self.transition_property_count())
.any(|t| t.seconds() > 0.)
(0..self.transition_property_count()).any(|index| {
let combined_duration =
self.transition_duration_mod(index).seconds().max(0.) +
self.transition_delay_mod(index).seconds();
combined_duration > 0.
})
}
/// Returns true if animation properties are equal between styles, but without