aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/traversal_flags.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/traversal_flags.rs')
-rw-r--r--components/style/traversal_flags.rs38
1 files changed, 19 insertions, 19 deletions
diff --git a/components/style/traversal_flags.rs b/components/style/traversal_flags.rs
index 5664aeeb31a..ba623b5451d 100644
--- a/components/style/traversal_flags.rs
+++ b/components/style/traversal_flags.rs
@@ -10,31 +10,31 @@
bitflags! {
/// Flags that control the traversal process.
- pub struct TraversalFlags: u32 {
+ pub flags TraversalFlags: u32 {
/// Traverse only elements for animation restyles.
- const AnimationOnly = 1 << 0;
+ const AnimationOnly = 1 << 0,
/// Traverse and update all elements with CSS animations since
/// @keyframes rules may have changed. Triggered by CSS rule changes.
- const ForCSSRuleChanges = 1 << 1;
+ const ForCSSRuleChanges = 1 << 1,
/// Styles unstyled elements, but does not handle invalidations on
/// already-styled elements.
- const UnstyledOnly = 1 << 2;
+ const UnstyledOnly = 1 << 2,
/// A forgetful traversal ignores the previous state of the frame tree, and
/// thus does not compute damage or maintain other state describing the styles
/// pre-traversal. A forgetful traversal is usually the right thing if you
/// aren't going to do a post-traversal.
- const Forgetful = 1 << 3;
+ const Forgetful = 1 << 3,
/// Clears all the dirty bits on the elements traversed.
- const ClearDirtyBits = 1 << 5;
+ const ClearDirtyBits = 1 << 5,
/// Clears the animation-only dirty descendants bit in the subtree.
- const ClearAnimationOnlyDirtyDescendants = 1 << 6;
+ const ClearAnimationOnlyDirtyDescendants = 1 << 6,
/// Allows the traversal to run in parallel if there are sufficient cores on
/// the machine.
- const ParallelTraversal = 1 << 7;
+ const ParallelTraversal = 1 << 7,
/// Flush throttled animations. By default, we only update throttled animations
/// when we have other non-throttled work to do. With this flag, we
/// unconditionally tick and process them.
- const FlushThrottledAnimations = 1 << 8;
+ const FlushThrottledAnimations = 1 << 8,
}
}
@@ -46,7 +46,7 @@ pub fn assert_traversal_flags_match() {
use gecko_bindings::structs;
macro_rules! check_traversal_flags {
- ( $( $a:ident => $b:path ),*, ) => {
+ ( $( $a:ident => $b:ident ),*, ) => {
if cfg!(debug_assertions) {
let mut modes = TraversalFlags::all();
$(
@@ -59,15 +59,15 @@ pub fn assert_traversal_flags_match() {
}
check_traversal_flags! {
- ServoTraversalFlags_AnimationOnly => TraversalFlags::AnimationOnly,
- ServoTraversalFlags_ForCSSRuleChanges => TraversalFlags::ForCSSRuleChanges,
- ServoTraversalFlags_UnstyledOnly => TraversalFlags::UnstyledOnly,
- ServoTraversalFlags_Forgetful => TraversalFlags::Forgetful,
- ServoTraversalFlags_ClearDirtyBits => TraversalFlags::ClearDirtyBits,
+ ServoTraversalFlags_AnimationOnly => AnimationOnly,
+ ServoTraversalFlags_ForCSSRuleChanges => ForCSSRuleChanges,
+ ServoTraversalFlags_UnstyledOnly => UnstyledOnly,
+ ServoTraversalFlags_Forgetful => Forgetful,
+ ServoTraversalFlags_ClearDirtyBits => ClearDirtyBits,
ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants =>
- TraversalFlags::ClearAnimationOnlyDirtyDescendants,
- ServoTraversalFlags_ParallelTraversal => TraversalFlags::ParallelTraversal,
- ServoTraversalFlags_FlushThrottledAnimations => TraversalFlags::FlushThrottledAnimations,
+ ClearAnimationOnlyDirtyDescendants,
+ ServoTraversalFlags_ParallelTraversal => ParallelTraversal,
+ ServoTraversalFlags_FlushThrottledAnimations => FlushThrottledAnimations,
}
}
@@ -75,6 +75,6 @@ impl TraversalFlags {
/// Returns true if the traversal is for animation-only restyles.
#[inline]
pub fn for_animation_only(&self) -> bool {
- self.contains(TraversalFlags::AnimationOnly)
+ self.contains(AnimationOnly)
}
}