mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Add a function that returns new rules by removing transition level rule.
This will be used for after-change-style of CSS Transition.
This commit is contained in:
parent
4c4b01954c
commit
959f1c8360
1 changed files with 10 additions and 0 deletions
|
@ -239,6 +239,16 @@ impl RuleTree {
|
||||||
// necessary.
|
// necessary.
|
||||||
Some(self.insert_ordered_rules_from(current, children.into_iter().rev()))
|
Some(self.insert_ordered_rules_from(current, children.into_iter().rev()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns new rule nodes without Transitions level rule.
|
||||||
|
pub fn remove_transition_rule_if_applicable(&self, path: &StrongRuleNode) -> StrongRuleNode {
|
||||||
|
// Return a clone if there is no transition level.
|
||||||
|
if path.cascade_level() != CascadeLevel::Transitions {
|
||||||
|
return path.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
path.parent().unwrap().clone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The number of RuleNodes added to the free list before we will consider
|
/// The number of RuleNodes added to the free list before we will consider
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue