mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Introduce eRestyle_CSSAnimations.
RESTYLE_CSS_ANIMATIONS will be individually processed prior to other restyle hints in a traversal.
This commit is contained in:
parent
6d5ee2e361
commit
7c4f4d5be9
3 changed files with 49 additions and 6 deletions
|
@ -9,7 +9,7 @@
|
|||
use dom::TElement;
|
||||
use properties::ComputedValues;
|
||||
use properties::longhands::display::computed_value as display;
|
||||
use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint};
|
||||
use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint};
|
||||
use rule_tree::StrongRuleNode;
|
||||
use selector_parser::{PseudoElement, RestyleDamage, Snapshot};
|
||||
use std::collections::HashMap;
|
||||
|
@ -136,7 +136,12 @@ pub struct StoredRestyleHint(RestyleHint);
|
|||
impl StoredRestyleHint {
|
||||
/// Propagates this restyle hint to a child element.
|
||||
pub fn propagate(&self) -> Self {
|
||||
StoredRestyleHint(if self.0.contains(RESTYLE_DESCENDANTS) {
|
||||
// If we have RESTYLE_CSS_ANIMATIONS restyle hint, it means we are in the
|
||||
// middle of an animation only restyle. In that case, we don't need to
|
||||
// propagate any restyle hints.
|
||||
StoredRestyleHint(if self.0.contains(RESTYLE_CSS_ANIMATIONS) {
|
||||
RestyleHint::empty()
|
||||
} else if self.0.contains(RESTYLE_DESCENDANTS) {
|
||||
RESTYLE_SELF | RESTYLE_DESCENDANTS
|
||||
} else {
|
||||
RestyleHint::empty()
|
||||
|
@ -174,6 +179,16 @@ impl StoredRestyleHint {
|
|||
pub fn insert(&mut self, other: &Self) {
|
||||
self.0 |= other.0
|
||||
}
|
||||
|
||||
/// Remove animation restyle hint.
|
||||
pub fn remove_animation_hint(&mut self) {
|
||||
self.0.remove(RESTYLE_CSS_ANIMATIONS)
|
||||
}
|
||||
|
||||
/// Returns true if the hint has animation-only restyle.
|
||||
pub fn has_animation_hint(&self) -> bool {
|
||||
self.0.contains(RESTYLE_CSS_ANIMATIONS)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for StoredRestyleHint {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue