aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Holmer <holmerj@uindy.edu>2016-01-13 11:56:50 -0500
committerJoshua Holmer <holmerj@uindy.edu>2016-01-13 18:14:12 -0500
commit83e66d69590b52728de469493548e6164f017fac (patch)
tree45a43e6b0f38fdb93b5954b72b1650d938f60646
parent3c6e16c9add63b421deae422cf98a65fabadb410 (diff)
downloadservo-83e66d69590b52728de469493548e6164f017fac.tar.gz
servo-83e66d69590b52728de469493548e6164f017fac.zip
Move AnimationState to script_traits
Resolves #9223
-rw-r--r--components/compositing/compositor.rs4
-rw-r--r--components/compositing/compositor_thread.rs5
-rw-r--r--components/compositing/constellation.rs4
-rw-r--r--components/compositing/headless.rs2
-rw-r--r--components/layout/animation.rs4
-rw-r--r--components/msg/constellation_msg.rs8
-rw-r--r--components/script/dom/document.rs5
-rw-r--r--components/script_traits/lib.rs14
-rw-r--r--components/script_traits/script_msg.rs3
9 files changed, 27 insertions, 22 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 03be8bcef24..524f59585c2 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -27,14 +27,14 @@ use layers::rendergl;
use layers::rendergl::RenderContext;
use layers::scene::Scene;
use layout_traits::LayoutControlChan;
-use msg::constellation_msg::{AnimationState, Image, PixelFormat};
+use msg::constellation_msg::{Image, PixelFormat};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, MouseButton};
use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData};
use pipeline::CompositionPipeline;
use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest};
use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::CompositorEvent::{MouseMoveEvent, TouchEvent};
-use script_traits::{ConstellationControlMsg, LayoutControlMsg};
+use script_traits::{AnimationState, ConstellationControlMsg, LayoutControlMsg};
use script_traits::{TouchEventType, TouchId};
use scrolling::ScrollingTimerProxy;
use std::collections::hash_map::Entry::{Occupied, Vacant};
diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs
index 98a65863f77..a9da70763b1 100644
--- a/components/compositing/compositor_thread.rs
+++ b/components/compositing/compositor_thread.rs
@@ -13,11 +13,10 @@ use headless;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use layers::layers::{BufferRequest, LayerBufferSet};
use layers::platform::surface::{NativeDisplay, NativeSurface};
-use msg::constellation_msg::{AnimationState, PipelineId};
-use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState};
+use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState, PipelineId};
use profile_traits::mem;
use profile_traits::time;
-use script_traits::{EventResult, ScriptToCompositorMsg};
+use script_traits::{AnimationState, EventResult, ScriptToCompositorMsg};
use std::fmt::{Debug, Error, Formatter};
use std::rc::Rc;
use std::sync::mpsc::{Receiver, Sender, channel};
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs
index 90d244868ba..4f74a90aedb 100644
--- a/components/compositing/constellation.rs
+++ b/components/compositing/constellation.rs
@@ -26,7 +26,6 @@ use gfx_traits::{Epoch, PaintMsg as FromPaintMsg};
use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender};
use ipc_channel::router::ROUTER;
use layout_traits::{LayoutControlChan, LayoutThreadFactory};
-use msg::constellation_msg::AnimationState;
use msg::constellation_msg::WebDriverCommandMsg;
use msg::constellation_msg::{FrameId, PipelineId};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
@@ -42,7 +41,8 @@ use pipeline::{CompositionPipeline, InitialPipelineState, Pipeline, Unprivileged
use profile_traits::mem;
use profile_traits::time;
use sandboxing;
-use script_traits::{CompositorEvent, ConstellationControlMsg, DocumentState, LayoutControlMsg};
+use script_traits::{AnimationState, CompositorEvent, ConstellationControlMsg};
+use script_traits::{DocumentState, LayoutControlMsg};
use script_traits::{IFrameLoadInfo, IFrameSandboxState, MozBrowserEvent, TimerEventRequest};
use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory};
use std::borrow::ToOwned;
diff --git a/components/compositing/headless.rs b/components/compositing/headless.rs
index 7289f805133..e575baade2a 100644
--- a/components/compositing/headless.rs
+++ b/components/compositing/headless.rs
@@ -7,10 +7,10 @@ use compositor_thread::{CompositorEventListener, CompositorReceiver};
use compositor_thread::{InitialCompositorState, Msg};
use euclid::scale_factor::ScaleFactor;
use euclid::{Point2D, Size2D};
-use msg::constellation_msg::AnimationState;
use msg::constellation_msg::WindowSizeData;
use profile_traits::mem;
use profile_traits::time;
+use script_traits::AnimationState;
use std::sync::mpsc::Sender;
use util::opts;
use windowing::WindowEvent;
diff --git a/components/layout/animation.rs b/components/layout/animation.rs
index 4deafeafa64..e706a74e524 100644
--- a/components/layout/animation.rs
+++ b/components/layout/animation.rs
@@ -7,8 +7,8 @@
use flow::{self, Flow};
use gfx::display_list::OpaqueNode;
use incremental::RestyleDamage;
-use msg::constellation_msg::{AnimationState, ConstellationChan, PipelineId};
-use script_traits::LayoutMsg as ConstellationMsg;
+use msg::constellation_msg::{ConstellationChan, PipelineId};
+use script_traits::{AnimationState, LayoutMsg as ConstellationMsg};
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::sync::mpsc::Receiver;
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs
index 46fda6511e0..5794453cccb 100644
--- a/components/msg/constellation_msg.rs
+++ b/components/msg/constellation_msg.rs
@@ -211,14 +211,6 @@ pub enum MouseButton {
Right,
}
-#[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)]
-pub enum AnimationState {
- AnimationsPresent,
- AnimationCallbacksPresent,
- NoAnimationsPresent,
- NoAnimationCallbacksPresent,
-}
-
#[derive(Deserialize, Serialize)]
pub enum WebDriverCommandMsg {
LoadUrl(PipelineId, LoadData, IpcSender<LoadStatus>),
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 65987f4bf3e..d959452dfd2 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -81,15 +81,14 @@ use js::jsapi::{JSContext, JSObject, JSRuntime};
use layout_interface::{HitTestResponse, MouseOverResponse};
use layout_interface::{LayoutChan, Msg, ReflowQueryType};
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
-use msg::constellation_msg::{AnimationState, PipelineId};
use msg::constellation_msg::{ConstellationChan, Key, KeyModifiers, KeyState};
-use msg::constellation_msg::{MouseButton, SubpageId};
+use msg::constellation_msg::{MouseButton, PipelineId, SubpageId};
use net_traits::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl};
use net_traits::CookieSource::NonHTTP;
use net_traits::{AsyncResponseTarget, PendingAsyncLoad};
use num::ToPrimitive;
use script_thread::{MainThreadScriptMsg, Runnable};
-use script_traits::{MouseEventType, MozBrowserEvent};
+use script_traits::{AnimationState, MouseEventType, MozBrowserEvent};
use script_traits::{ScriptMsg as ConstellationMsg, ScriptToCompositorMsg};
use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress};
use std::ascii::AsciiExt;
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index d9fcba984ad..93db6cd52d2 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -156,6 +156,20 @@ pub enum DocumentState {
Pending,
}
+/// For a given pipeline, whether any animations are currently running
+/// and any animation callbacks are queued
+#[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)]
+pub enum AnimationState {
+ /// Animations are active but no callbacks are queued
+ AnimationsPresent,
+ /// Animations are active and callbacks are queued
+ AnimationCallbacksPresent,
+ /// No animations are active and no callbacks are queued
+ NoAnimationsPresent,
+ /// No animations are active but callbacks are queued
+ NoAnimationCallbacksPresent,
+}
+
/// The type of input represented by a multi-touch event.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum TouchEventType {
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
index b4e8e587a3d..cc2104daf71 100644
--- a/components/script_traits/script_msg.rs
+++ b/components/script_traits/script_msg.rs
@@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use AnimationState;
use DocumentState;
use IFrameLoadInfo;
use MouseEventType;
@@ -10,7 +11,7 @@ use canvas_traits::CanvasMsg;
use euclid::point::Point2D;
use euclid::size::Size2D;
use ipc_channel::ipc::IpcSender;
-use msg::constellation_msg::{AnimationState, NavigationDirection, Failure, PipelineId};
+use msg::constellation_msg::{Failure, NavigationDirection, PipelineId};
use msg::constellation_msg::{LoadData, MouseButton, SubpageId};
use offscreen_gl_context::GLContextAttributes;
use style_traits::viewport::ViewportConstraints;