Add a new TraversalRestyleBehavior that represents the traversal is triggered by CSS rule changes.

And propagate the new flag to servo if mRestyleForCSSRuleChanges is set.
This commit is contained in:
Hiroyuki Ikezoe 2017-05-19 13:15:54 +09:00
parent 1602edb04a
commit dd29fc1f68
2 changed files with 13 additions and 3 deletions

View file

@ -37,6 +37,10 @@ bitflags! {
const ANIMATION_ONLY = 0x02,
/// Traverse without generating any change hints.
const FOR_RECONSTRUCT = 0x04,
/// Traverse triggered by CSS rule changes.
/// Traverse and update all elements with CSS animations since
/// @keyframes rules may have changed
const FOR_CSS_RULE_CHANGES = 0x08,
}
}
@ -55,6 +59,11 @@ impl TraversalFlags {
pub fn for_reconstruct(&self) -> bool {
self.contains(FOR_RECONSTRUCT)
}
/// Returns true if the traversal is triggered by CSS rule changes.
pub fn for_css_rule_changes(&self) -> bool {
self.contains(FOR_CSS_RULE_CHANGES)
}
}
/// This structure exists to enforce that callers invoke pre_traverse, and also