Move AnimationState to script_traits

Resolves #9223
This commit is contained in:
Joshua Holmer 2016-01-13 11:56:50 -05:00
parent 3c6e16c9ad
commit 83e66d6959
9 changed files with 27 additions and 22 deletions

View file

@ -27,14 +27,14 @@ use layers::rendergl;
use layers::rendergl::RenderContext; use layers::rendergl::RenderContext;
use layers::scene::Scene; use layers::scene::Scene;
use layout_traits::LayoutControlChan; 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::{Key, KeyModifiers, KeyState, LoadData, MouseButton};
use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData}; use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData};
use pipeline::CompositionPipeline; use pipeline::CompositionPipeline;
use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest}; use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest};
use profile_traits::time::{self, ProfilerCategory, profile}; use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::CompositorEvent::{MouseMoveEvent, TouchEvent}; use script_traits::CompositorEvent::{MouseMoveEvent, TouchEvent};
use script_traits::{ConstellationControlMsg, LayoutControlMsg}; use script_traits::{AnimationState, ConstellationControlMsg, LayoutControlMsg};
use script_traits::{TouchEventType, TouchId}; use script_traits::{TouchEventType, TouchId};
use scrolling::ScrollingTimerProxy; use scrolling::ScrollingTimerProxy;
use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_map::Entry::{Occupied, Vacant};

View file

@ -13,11 +13,10 @@ use headless;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use layers::layers::{BufferRequest, LayerBufferSet}; use layers::layers::{BufferRequest, LayerBufferSet};
use layers::platform::surface::{NativeDisplay, NativeSurface}; use layers::platform::surface::{NativeDisplay, NativeSurface};
use msg::constellation_msg::{AnimationState, PipelineId}; use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState, PipelineId};
use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState};
use profile_traits::mem; use profile_traits::mem;
use profile_traits::time; use profile_traits::time;
use script_traits::{EventResult, ScriptToCompositorMsg}; use script_traits::{AnimationState, EventResult, ScriptToCompositorMsg};
use std::fmt::{Debug, Error, Formatter}; use std::fmt::{Debug, Error, Formatter};
use std::rc::Rc; use std::rc::Rc;
use std::sync::mpsc::{Receiver, Sender, channel}; use std::sync::mpsc::{Receiver, Sender, channel};

View file

@ -26,7 +26,6 @@ use gfx_traits::{Epoch, PaintMsg as FromPaintMsg};
use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender}; use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use layout_traits::{LayoutControlChan, LayoutThreadFactory}; use layout_traits::{LayoutControlChan, LayoutThreadFactory};
use msg::constellation_msg::AnimationState;
use msg::constellation_msg::WebDriverCommandMsg; use msg::constellation_msg::WebDriverCommandMsg;
use msg::constellation_msg::{FrameId, PipelineId}; use msg::constellation_msg::{FrameId, PipelineId};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; 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::mem;
use profile_traits::time; use profile_traits::time;
use sandboxing; 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::{IFrameLoadInfo, IFrameSandboxState, MozBrowserEvent, TimerEventRequest};
use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory}; use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory};
use std::borrow::ToOwned; use std::borrow::ToOwned;

View file

@ -7,10 +7,10 @@ use compositor_thread::{CompositorEventListener, CompositorReceiver};
use compositor_thread::{InitialCompositorState, Msg}; use compositor_thread::{InitialCompositorState, Msg};
use euclid::scale_factor::ScaleFactor; use euclid::scale_factor::ScaleFactor;
use euclid::{Point2D, Size2D}; use euclid::{Point2D, Size2D};
use msg::constellation_msg::AnimationState;
use msg::constellation_msg::WindowSizeData; use msg::constellation_msg::WindowSizeData;
use profile_traits::mem; use profile_traits::mem;
use profile_traits::time; use profile_traits::time;
use script_traits::AnimationState;
use std::sync::mpsc::Sender; use std::sync::mpsc::Sender;
use util::opts; use util::opts;
use windowing::WindowEvent; use windowing::WindowEvent;

View file

@ -7,8 +7,8 @@
use flow::{self, Flow}; use flow::{self, Flow};
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
use incremental::RestyleDamage; use incremental::RestyleDamage;
use msg::constellation_msg::{AnimationState, ConstellationChan, PipelineId}; use msg::constellation_msg::{ConstellationChan, PipelineId};
use script_traits::LayoutMsg as ConstellationMsg; use script_traits::{AnimationState, LayoutMsg as ConstellationMsg};
use std::collections::HashMap; use std::collections::HashMap;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;
use std::sync::mpsc::Receiver; use std::sync::mpsc::Receiver;

View file

@ -211,14 +211,6 @@ pub enum MouseButton {
Right, Right,
} }
#[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)]
pub enum AnimationState {
AnimationsPresent,
AnimationCallbacksPresent,
NoAnimationsPresent,
NoAnimationCallbacksPresent,
}
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub enum WebDriverCommandMsg { pub enum WebDriverCommandMsg {
LoadUrl(PipelineId, LoadData, IpcSender<LoadStatus>), LoadUrl(PipelineId, LoadData, IpcSender<LoadStatus>),

View file

@ -81,15 +81,14 @@ use js::jsapi::{JSContext, JSObject, JSRuntime};
use layout_interface::{HitTestResponse, MouseOverResponse}; use layout_interface::{HitTestResponse, MouseOverResponse};
use layout_interface::{LayoutChan, Msg, ReflowQueryType}; use layout_interface::{LayoutChan, Msg, ReflowQueryType};
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER}; 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::{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::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl};
use net_traits::CookieSource::NonHTTP; use net_traits::CookieSource::NonHTTP;
use net_traits::{AsyncResponseTarget, PendingAsyncLoad}; use net_traits::{AsyncResponseTarget, PendingAsyncLoad};
use num::ToPrimitive; use num::ToPrimitive;
use script_thread::{MainThreadScriptMsg, Runnable}; 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::{ScriptMsg as ConstellationMsg, ScriptToCompositorMsg};
use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress}; use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress};
use std::ascii::AsciiExt; use std::ascii::AsciiExt;

View file

@ -156,6 +156,20 @@ pub enum DocumentState {
Pending, 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. /// The type of input represented by a multi-touch event.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum TouchEventType { pub enum TouchEventType {

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use AnimationState;
use DocumentState; use DocumentState;
use IFrameLoadInfo; use IFrameLoadInfo;
use MouseEventType; use MouseEventType;
@ -10,7 +11,7 @@ use canvas_traits::CanvasMsg;
use euclid::point::Point2D; use euclid::point::Point2D;
use euclid::size::Size2D; use euclid::size::Size2D;
use ipc_channel::ipc::IpcSender; 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 msg::constellation_msg::{LoadData, MouseButton, SubpageId};
use offscreen_gl_context::GLContextAttributes; use offscreen_gl_context::GLContextAttributes;
use style_traits::viewport::ViewportConstraints; use style_traits::viewport::ViewportConstraints;