mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Pass TraversalFlags from C++ into Rust.
MozReview-Commit-ID: EVUzgnL5coN
This commit is contained in:
parent
c365a39104
commit
ce295f6daf
9 changed files with 107 additions and 91 deletions
|
@ -19,6 +19,7 @@ use rule_tree::{CascadeLevel, StrongRuleNode};
|
|||
use selector_parser::{PseudoElement, RestyleDamage};
|
||||
use selectors::matching::ElementSelectorFlags;
|
||||
use servo_arc::{Arc, ArcBorrow};
|
||||
use traversal_flags;
|
||||
|
||||
/// Represents the result of comparing an element's old and new style.
|
||||
pub struct StyleDifference {
|
||||
|
@ -172,7 +173,7 @@ trait PrivateMatchMethods: TElement {
|
|||
// running or not.
|
||||
// TODO: We should check which @keyframes changed/added/deleted
|
||||
// and update only animations corresponding to those @keyframes.
|
||||
(context.shared.traversal_flags.for_css_rule_changes() &&
|
||||
(context.shared.traversal_flags.contains(traversal_flags::ForCSSRuleChanges) &&
|
||||
has_new_animation_style) ||
|
||||
!old_box_style.animations_equals(&new_box_style) ||
|
||||
(old_display_style == display::T::none &&
|
||||
|
@ -302,7 +303,7 @@ trait PrivateMatchMethods: TElement {
|
|||
pseudo: Option<&PseudoElement>)
|
||||
-> ChildCascadeRequirement {
|
||||
// Don't accumulate damage if we're in a restyle for reconstruction.
|
||||
if shared_context.traversal_flags.for_reconstruct() {
|
||||
if shared_context.traversal_flags.contains(traversal_flags::ForReconstruct) {
|
||||
return ChildCascadeRequirement::MustCascadeChildren;
|
||||
}
|
||||
|
||||
|
@ -499,7 +500,7 @@ pub trait MatchMethods : TElement {
|
|||
}
|
||||
|
||||
// Don't accumulate damage if we're in a restyle for reconstruction.
|
||||
if context.shared.traversal_flags.for_reconstruct() {
|
||||
if context.shared.traversal_flags.contains(traversal_flags::ForReconstruct) {
|
||||
return ChildCascadeRequirement::MustCascadeChildren;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue