aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/message.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2020-05-07 18:37:18 +0200
committerMartin Robinson <mrobinson@igalia.com>2020-05-12 10:22:14 +0200
commit3b0619aedd967238091367f6e03dabf262e116ad (patch)
treeb2427a9f19befc3017860053d3a416fda3d87275 /components/script_layout_interface/message.rs
parentaa9f16ce45f6eb22ffd5bc6a10802ded4cc2319b (diff)
downloadservo-3b0619aedd967238091367f6e03dabf262e116ad.tar.gz
servo-3b0619aedd967238091367f6e03dabf262e116ad.zip
Move most animation processing to script
This is preparation for sharing this code with layout_2020 and implementing selective off-the-main-thread animations. We still look for nodes not in the flow tree in the layout thread.
Diffstat (limited to 'components/script_layout_interface/message.rs')
-rw-r--r--components/script_layout_interface/message.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs
index ac5c0c59ba0..1dcbfe7eb33 100644
--- a/components/script_layout_interface/message.rs
+++ b/components/script_layout_interface/message.rs
@@ -7,20 +7,25 @@ use crate::{PendingImage, TrustedNodeAddress};
use app_units::Au;
use crossbeam_channel::{Receiver, Sender};
use euclid::default::{Point2D, Rect};
+use fxhash::FxHashMap;
use gfx_traits::Epoch;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use metrics::PaintTimeMetrics;
use msg::constellation_msg::{BackgroundHangMonitorRegister, BrowsingContextId, PipelineId};
use net_traits::image_cache::ImageCache;
+use parking_lot::RwLock;
use profile_traits::mem::ReportsChan;
use script_traits::Painter;
-use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg};
-use script_traits::{ScrollState, UntrustedNodeAddress, WindowSizeData};
+use script_traits::{
+ ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg, ScrollState,
+ WindowSizeData,
+};
use servo_arc::Arc as ServoArc;
use servo_atoms::Atom;
use servo_url::{ImmutableOrigin, ServoUrl};
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
+use style::animation::ElementAnimationSet;
use style::context::QuirksMode;
use style::dom::OpaqueNode;
use style::invalidation::element::restyle_hints::RestyleHint;
@@ -87,9 +92,6 @@ pub enum Msg {
/// Send to layout the precise time when the navigation started.
SetNavigationStart(u64),
-
- /// Request the current number of animations that are running.
- GetRunningAnimations(IpcSender<usize>),
}
#[derive(Debug, PartialEq)]
@@ -183,8 +185,6 @@ pub struct Reflow {
pub struct ReflowComplete {
/// The list of images that were encountered that are in progress.
pub pending_images: Vec<PendingImage>,
- /// The list of nodes that initiated a CSS transition.
- pub newly_animating_nodes: Vec<UntrustedNodeAddress>,
}
/// Information needed for a script-initiated reflow.
@@ -209,6 +209,8 @@ pub struct ScriptReflow {
pub pending_restyles: Vec<(TrustedNodeAddress, PendingRestyle)>,
/// The current animation timeline value.
pub animation_timeline_value: f64,
+ /// The set of animations for this document.
+ pub animations: ServoArc<RwLock<FxHashMap<OpaqueNode, ElementAnimationSet>>>,
}
pub struct LayoutThreadInit {