mirror of
https://github.com/servo/servo.git
synced 2025-06-28 19:13:41 +01:00
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:
parent
1602edb04a
commit
dd29fc1f68
2 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue