mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Bug 1331047: Implement the new traversal semantics for stylo. r=bholley,hiro
MozReview-Commit-ID: 4BXx9JpGZKX Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
85ad961104
commit
be0139ff3c
11 changed files with 548 additions and 363 deletions
|
@ -20,7 +20,6 @@ use font_metrics::FontMetricsProvider;
|
|||
use matching::StyleSharingCandidateCache;
|
||||
use parking_lot::RwLock;
|
||||
#[cfg(feature = "gecko")] use properties::ComputedValues;
|
||||
#[cfg(feature = "gecko")] use selector_parser::PseudoElement;
|
||||
use selectors::matching::ElementSelectorFlags;
|
||||
#[cfg(feature = "servo")] use servo_config::opts;
|
||||
use shared_lock::StylesheetGuards;
|
||||
|
@ -270,7 +269,8 @@ impl TraversalStatistics {
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
bitflags! {
|
||||
/// Represents which tasks are performed in a SequentialTask of UpdateAnimations.
|
||||
/// Represents which tasks are performed in a SequentialTask of
|
||||
/// UpdateAnimations.
|
||||
pub flags UpdateAnimationsTasks: u8 {
|
||||
/// Update CSS Animations.
|
||||
const CSS_ANIMATIONS = structs::UpdateAnimationsTasks_CSSAnimations,
|
||||
|
@ -296,10 +296,8 @@ pub enum SequentialTask<E: TElement> {
|
|||
/// of the non-animation style traversal, and updating the computed effect properties.
|
||||
#[cfg(feature = "gecko")]
|
||||
UpdateAnimations {
|
||||
/// The target element.
|
||||
/// The target element or pseudo-element.
|
||||
el: SendElement<E>,
|
||||
/// The target pseudo element.
|
||||
pseudo: Option<PseudoElement>,
|
||||
/// The before-change style for transitions. We use before-change style as the initial
|
||||
/// value of its Keyframe. Required if |tasks| includes CSSTransitions.
|
||||
before_change_style: Option<Arc<ComputedValues>>,
|
||||
|
@ -316,8 +314,8 @@ impl<E: TElement> SequentialTask<E> {
|
|||
match self {
|
||||
Unused(_) => unreachable!(),
|
||||
#[cfg(feature = "gecko")]
|
||||
UpdateAnimations { el, pseudo, before_change_style, tasks } => {
|
||||
unsafe { el.update_animations(pseudo.as_ref(), before_change_style, tasks) };
|
||||
UpdateAnimations { el, before_change_style, tasks } => {
|
||||
unsafe { el.update_animations(before_change_style, tasks) };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -326,14 +324,14 @@ impl<E: TElement> SequentialTask<E> {
|
|||
/// a given (pseudo-)element.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub fn update_animations(el: E,
|
||||
pseudo: Option<PseudoElement>,
|
||||
before_change_style: Option<Arc<ComputedValues>>,
|
||||
tasks: UpdateAnimationsTasks) -> Self {
|
||||
use self::SequentialTask::*;
|
||||
UpdateAnimations { el: unsafe { SendElement::new(el) },
|
||||
pseudo: pseudo,
|
||||
before_change_style: before_change_style,
|
||||
tasks: tasks }
|
||||
UpdateAnimations {
|
||||
el: unsafe { SendElement::new(el) },
|
||||
before_change_style: before_change_style,
|
||||
tasks: tasks,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue