mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Move AnimationRules into declaration_block.rs.
This commit is contained in:
parent
d30c4fe79d
commit
35e0e3aa11
5 changed files with 22 additions and 21 deletions
|
@ -13,7 +13,7 @@ use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
|
|||
use data::ElementData;
|
||||
use element_state::ElementState;
|
||||
use font_metrics::FontMetricsProvider;
|
||||
use properties::{ComputedValues, PropertyDeclarationBlock};
|
||||
use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
|
||||
#[cfg(feature = "gecko")] use properties::animated_properties::AnimationValue;
|
||||
#[cfg(feature = "gecko")] use properties::animated_properties::TransitionProperty;
|
||||
use rule_tree::CascadeLevel;
|
||||
|
@ -274,20 +274,6 @@ pub trait PresentationalHintsSynthesizer {
|
|||
where V: Push<ApplicableDeclarationBlock>;
|
||||
}
|
||||
|
||||
/// The animation rules.
|
||||
///
|
||||
/// The first one is for Animation cascade level, and the second one is for
|
||||
/// Transition cascade level.
|
||||
pub struct AnimationRules(pub Option<Arc<Locked<PropertyDeclarationBlock>>>,
|
||||
pub Option<Arc<Locked<PropertyDeclarationBlock>>>);
|
||||
|
||||
impl AnimationRules {
|
||||
/// Returns whether these animation rules represents an actual rule or not.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_none() && self.1.is_none()
|
||||
}
|
||||
}
|
||||
|
||||
/// The element trait, the main abstraction the style crate acts over.
|
||||
pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
|
||||
ElementExt + PresentationalHintsSynthesizer {
|
||||
|
|
|
@ -18,7 +18,7 @@ use app_units::Au;
|
|||
use atomic_refcell::AtomicRefCell;
|
||||
use context::{QuirksMode, SharedStyleContext, UpdateAnimationsTasks};
|
||||
use data::ElementData;
|
||||
use dom::{self, AnimationRules, DescendantsBit, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode};
|
||||
use dom::{self, DescendantsBit, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode};
|
||||
use dom::{OpaqueNode, PresentationalHintsSynthesizer};
|
||||
use element_state::ElementState;
|
||||
use error_reporting::RustLogReporter;
|
||||
|
@ -57,7 +57,7 @@ use gecko_bindings::structs::NODE_IS_NATIVE_ANONYMOUS;
|
|||
use gecko_bindings::sugar::ownership::HasArcFFI;
|
||||
use logical_geometry::WritingMode;
|
||||
use media_queries::Device;
|
||||
use properties::{ComputedValues, parse_style_attribute};
|
||||
use properties::{AnimationRules, ComputedValues, parse_style_attribute};
|
||||
use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock};
|
||||
use properties::animated_properties::{AnimationValue, AnimationValueMap, TransitionProperty};
|
||||
use properties::style_structs::Font;
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
use cascade_info::CascadeInfo;
|
||||
use context::{SelectorFlagsMap, SharedStyleContext, StyleContext};
|
||||
use data::{ComputedStyle, ElementData, RestyleData};
|
||||
use dom::{AnimationRules, TElement, TNode};
|
||||
use dom::{TElement, TNode};
|
||||
use font_metrics::FontMetricsProvider;
|
||||
use log::LogLevel::Trace;
|
||||
use properties::{CascadeFlags, ComputedValues, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade};
|
||||
use properties::{AnimationRules, CascadeFlags, ComputedValues, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade};
|
||||
use properties::longhands::display::computed_value as display;
|
||||
use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_CSS_TRANSITIONS, RestyleReplacements};
|
||||
use restyle_hints::{RESTYLE_STYLE_ATTRIBUTE, RESTYLE_SMIL};
|
||||
|
|
|
@ -11,6 +11,7 @@ use cssparser::{DeclarationListParser, parse_important};
|
|||
use cssparser::{Parser, AtRuleParser, DeclarationParser, Delimiter};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use parser::{PARSING_MODE_DEFAULT, ParsingMode, ParserContext, log_css_error};
|
||||
use shared_lock::Locked;
|
||||
use std::fmt;
|
||||
use std::slice::Iter;
|
||||
use style_traits::ToCss;
|
||||
|
@ -18,6 +19,20 @@ use stylesheets::{CssRuleType, Origin, UrlExtraData};
|
|||
use super::*;
|
||||
#[cfg(feature = "gecko")] use properties::animated_properties::AnimationValueMap;
|
||||
|
||||
/// The animation rules.
|
||||
///
|
||||
/// The first one is for Animation cascade level, and the second one is for
|
||||
/// Transition cascade level.
|
||||
pub struct AnimationRules(pub Option<Arc<Locked<PropertyDeclarationBlock>>>,
|
||||
pub Option<Arc<Locked<PropertyDeclarationBlock>>>);
|
||||
|
||||
impl AnimationRules {
|
||||
/// Returns whether these animation rules represents an actual rule or not.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_none() && self.1.is_none()
|
||||
}
|
||||
}
|
||||
|
||||
/// A declaration [importance][importance].
|
||||
///
|
||||
/// [importance]: https://drafts.csswg.org/css-cascade/#importance
|
||||
|
|
|
@ -8,7 +8,7 @@ use {Atom, LocalName, Namespace};
|
|||
use bit_vec::BitVec;
|
||||
use context::{QuirksMode, SharedStyleContext};
|
||||
use data::ComputedStyle;
|
||||
use dom::{AnimationRules, TElement};
|
||||
use dom::TElement;
|
||||
use element_state::ElementState;
|
||||
use error_reporting::RustLogReporter;
|
||||
use font_metrics::FontMetricsProvider;
|
||||
|
@ -17,9 +17,9 @@ use gecko_bindings::structs::nsIAtom;
|
|||
use keyframes::KeyframesAnimation;
|
||||
use media_queries::Device;
|
||||
use properties::{self, CascadeFlags, ComputedValues};
|
||||
use properties::{AnimationRules, PropertyDeclarationBlock};
|
||||
#[cfg(feature = "servo")]
|
||||
use properties::INHERIT_ALL;
|
||||
use properties::PropertyDeclarationBlock;
|
||||
use restyle_hints::{HintComputationContext, DependencySet, RestyleHint};
|
||||
use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
|
||||
use selector_map::{SelectorMap, SelectorMapEntry};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue