mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
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:
parent
8b56b7a3c2
commit
364235ac0c
17 changed files with 314 additions and 216 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue