mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags versions.
This commit is contained in:
parent
4cf2ce66fc
commit
e8e2d0a4b2
142 changed files with 1685 additions and 1635 deletions
|
@ -11,8 +11,6 @@ use context::{ElementCascadeInputs, QuirksMode, SelectorFlagsMap};
|
|||
use context::{SharedStyleContext, StyleContext};
|
||||
use data::ElementData;
|
||||
use dom::TElement;
|
||||
use invalidation::element::restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_CSS_TRANSITIONS};
|
||||
use invalidation::element::restyle_hints::{RESTYLE_SMIL, RESTYLE_STYLE_ATTRIBUTE};
|
||||
use invalidation::element::restyle_hints::RestyleHint;
|
||||
use properties::ComputedValues;
|
||||
use rule_tree::{CascadeLevel, StrongRuleNode};
|
||||
|
@ -20,7 +18,7 @@ use selector_parser::{PseudoElement, RestyleDamage};
|
|||
use selectors::matching::ElementSelectorFlags;
|
||||
use servo_arc::{Arc, ArcBorrow};
|
||||
use style_resolver::ResolvedElementStyles;
|
||||
use traversal_flags;
|
||||
use traversal_flags::TraversalFlags;
|
||||
|
||||
/// Represents the result of comparing an element's old and new style.
|
||||
#[derive(Debug)]
|
||||
|
@ -161,7 +159,7 @@ trait PrivateMatchMethods: TElement {
|
|||
// animation is running or not.
|
||||
// TODO: We should check which @keyframes changed/added/deleted
|
||||
// and update only animations corresponding to those @keyframes.
|
||||
(context.shared.traversal_flags.contains(traversal_flags::ForCSSRuleChanges) &&
|
||||
(context.shared.traversal_flags.contains(TraversalFlags::ForCSSRuleChanges) &&
|
||||
(has_new_animation_style || has_animations)) ||
|
||||
!old_box_style.animations_equals(new_box_style) ||
|
||||
(old_display_style == display::T::none &&
|
||||
|
@ -183,10 +181,10 @@ trait PrivateMatchMethods: TElement {
|
|||
new_values: &ComputedValues,
|
||||
restyle_hints: RestyleHint
|
||||
) {
|
||||
use context::DISPLAY_CHANGED_FROM_NONE_FOR_SMIL;
|
||||
use context::PostAnimationTasks;
|
||||
use properties::longhands::display::computed_value as display;
|
||||
|
||||
if !restyle_hints.intersects(RESTYLE_SMIL) {
|
||||
if !restyle_hints.intersects(RestyleHint::RESTYLE_SMIL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -206,7 +204,7 @@ trait PrivateMatchMethods: TElement {
|
|||
// restyle).
|
||||
let task = ::context::SequentialTask::process_post_animation(
|
||||
*self,
|
||||
DISPLAY_CHANGED_FROM_NONE_FOR_SMIL,
|
||||
PostAnimationTasks::DISPLAY_CHANGED_FROM_NONE_FOR_SMIL,
|
||||
);
|
||||
context.thread_local.tasks.push(task);
|
||||
}
|
||||
|
@ -219,7 +217,6 @@ trait PrivateMatchMethods: TElement {
|
|||
new_values: &mut Arc<ComputedValues>,
|
||||
restyle_hint: RestyleHint,
|
||||
important_rules_changed: bool) {
|
||||
use context::{CASCADE_RESULTS, CSS_ANIMATIONS, CSS_TRANSITIONS, EFFECT_PROPERTIES};
|
||||
use context::UpdateAnimationsTasks;
|
||||
|
||||
if context.shared.traversal_flags.for_animation_only() {
|
||||
|
@ -237,7 +234,7 @@ trait PrivateMatchMethods: TElement {
|
|||
|
||||
let mut tasks = UpdateAnimationsTasks::empty();
|
||||
if self.needs_animations_update(context, old_values.as_ref(), new_values) {
|
||||
tasks.insert(CSS_ANIMATIONS);
|
||||
tasks.insert(UpdateAnimationsTasks::CSS_ANIMATIONS);
|
||||
}
|
||||
|
||||
let before_change_style = if self.might_need_transitions_update(old_values.as_ref().map(|s| &**s),
|
||||
|
@ -265,7 +262,7 @@ trait PrivateMatchMethods: TElement {
|
|||
if let Some(values_without_transitions) = after_change_style {
|
||||
*new_values = values_without_transitions;
|
||||
}
|
||||
tasks.insert(CSS_TRANSITIONS);
|
||||
tasks.insert(UpdateAnimationsTasks::CSS_TRANSITIONS);
|
||||
|
||||
// We need to clone old_values into SequentialTask, so we can use it later.
|
||||
old_values.clone()
|
||||
|
@ -277,9 +274,9 @@ trait PrivateMatchMethods: TElement {
|
|||
};
|
||||
|
||||
if self.has_animations() {
|
||||
tasks.insert(EFFECT_PROPERTIES);
|
||||
tasks.insert(UpdateAnimationsTasks::EFFECT_PROPERTIES);
|
||||
if important_rules_changed {
|
||||
tasks.insert(CASCADE_RESULTS);
|
||||
tasks.insert(UpdateAnimationsTasks::CASCADE_RESULTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +342,7 @@ trait PrivateMatchMethods: TElement {
|
|||
debug!("accumulate_damage_for: {:?}", self);
|
||||
|
||||
// Don't accumulate damage if we're in a forgetful traversal.
|
||||
if shared_context.traversal_flags.contains(traversal_flags::Forgetful) {
|
||||
if shared_context.traversal_flags.contains(TraversalFlags::Forgetful) {
|
||||
debug!(" > forgetful traversal");
|
||||
return ChildCascadeRequirement::MustCascadeChildren;
|
||||
}
|
||||
|
@ -401,7 +398,7 @@ trait PrivateMatchMethods: TElement {
|
|||
// seems not common enough to care about.
|
||||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
use values::specified::align;
|
||||
use values::specified::align::AlignFlags;
|
||||
|
||||
let old_justify_items =
|
||||
old_values.get_position().clone_justify_items();
|
||||
|
@ -409,10 +406,10 @@ trait PrivateMatchMethods: TElement {
|
|||
new_values.get_position().clone_justify_items();
|
||||
|
||||
let was_legacy_justify_items =
|
||||
old_justify_items.computed.0.contains(align::ALIGN_LEGACY);
|
||||
old_justify_items.computed.0.contains(AlignFlags::LEGACY);
|
||||
|
||||
let is_legacy_justify_items =
|
||||
new_justify_items.computed.0.contains(align::ALIGN_LEGACY);
|
||||
new_justify_items.computed.0.contains(AlignFlags::LEGACY);
|
||||
|
||||
if is_legacy_justify_items != was_legacy_justify_items {
|
||||
return ChildCascadeRequirement::MustCascadeChildren;
|
||||
|
@ -584,7 +581,7 @@ pub trait MatchMethods : TElement {
|
|||
}
|
||||
|
||||
// Don't accumulate damage if we're in a forgetful traversal.
|
||||
if context.shared.traversal_flags.contains(traversal_flags::Forgetful) {
|
||||
if context.shared.traversal_flags.contains(TraversalFlags::Forgetful) {
|
||||
return ChildCascadeRequirement::MustCascadeChildren;
|
||||
}
|
||||
|
||||
|
@ -768,7 +765,7 @@ pub trait MatchMethods : TElement {
|
|||
|
||||
if !context.shared.traversal_flags.for_animation_only() {
|
||||
let mut result = false;
|
||||
if replacements.contains(RESTYLE_STYLE_ATTRIBUTE) {
|
||||
if replacements.contains(RestyleHint::RESTYLE_STYLE_ATTRIBUTE) {
|
||||
let style_attribute = self.style_attribute();
|
||||
result |= replace_rule_node(CascadeLevel::StyleAttributeNormal,
|
||||
style_attribute,
|
||||
|
@ -790,7 +787,7 @@ pub trait MatchMethods : TElement {
|
|||
if replacements.intersects(RestyleHint::for_animations()) {
|
||||
debug_assert!(context.shared.traversal_flags.for_animation_only());
|
||||
|
||||
if replacements.contains(RESTYLE_SMIL) {
|
||||
if replacements.contains(RestyleHint::RESTYLE_SMIL) {
|
||||
replace_rule_node(CascadeLevel::SMILOverride,
|
||||
self.get_smil_override(),
|
||||
primary_rules);
|
||||
|
@ -806,12 +803,12 @@ pub trait MatchMethods : TElement {
|
|||
|
||||
// Apply Transition rules and Animation rules if the corresponding restyle hint
|
||||
// is contained.
|
||||
if replacements.contains(RESTYLE_CSS_TRANSITIONS) {
|
||||
if replacements.contains(RestyleHint::RESTYLE_CSS_TRANSITIONS) {
|
||||
replace_rule_node_for_animation(CascadeLevel::Transitions,
|
||||
primary_rules);
|
||||
}
|
||||
|
||||
if replacements.contains(RESTYLE_CSS_ANIMATIONS) {
|
||||
if replacements.contains(RestyleHint::RESTYLE_CSS_ANIMATIONS) {
|
||||
replace_rule_node_for_animation(CascadeLevel::Animations,
|
||||
primary_rules);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue