diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 6bffd1039c3..2daa652f6f4 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -28,7 +28,7 @@ use ipc_channel::router::ROUTER; use layout_traits::{LayoutControlChan, LayoutThreadFactory}; use msg::constellation_msg::AnimationState; use msg::constellation_msg::WebDriverCommandMsg; -use msg::constellation_msg::{DocumentState, FrameId, PipelineId}; +use msg::constellation_msg::{FrameId, PipelineId}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; use msg::constellation_msg::{MozBrowserEvent, NavigationDirection}; use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId}; @@ -43,7 +43,7 @@ use pipeline::{CompositionPipeline, InitialPipelineState, Pipeline, Unprivileged use profile_traits::mem; use profile_traits::time; use sandboxing; -use script_traits::{CompositorEvent, ConstellationControlMsg, LayoutControlMsg}; +use script_traits::{CompositorEvent, ConstellationControlMsg, DocumentState, LayoutControlMsg}; use script_traits::{IFrameLoadInfo, IFrameSandboxState}; use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory}; use script_traits::{TimerEventRequest}; diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 922785b7e25..d1e9b39b02b 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -219,15 +219,6 @@ pub enum AnimationState { NoAnimationCallbacksPresent, } -/// Used to determine if a script has any pending asynchronous activity. -#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Serialize)] -pub enum DocumentState { - /// The document has been loaded and is idle. - Idle, - /// The document is either loading or waiting on an event. - Pending, -} - // https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API#Events #[derive(Deserialize, Serialize)] pub enum MozBrowserEvent { diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 382007a2dec..8ae52b9ccb0 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -43,7 +43,7 @@ use js::rust::Runtime; use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowQueryType}; use libc; -use msg::constellation_msg::{ConstellationChan, DocumentState, LoadData}; +use msg::constellation_msg::{ConstellationChan, LoadData}; use msg::constellation_msg::{MozBrowserEvent, PipelineId, SubpageId, WindowSizeData}; use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; use net_traits::ResourceThread; @@ -58,7 +58,8 @@ use script_thread::{DOMManipulationThreadSource, UserInteractionThreadSource, Ne use script_thread::{HistoryTraversalThreadSource, FileReadingThreadSource, SendableMainThreadScriptChan}; use script_thread::{ScriptChan, ScriptPort, MainThreadScriptChan, MainThreadScriptMsg, RunnableWrapper}; use script_traits::ScriptMsg as ConstellationMsg; -use script_traits::{MsDuration, ScriptToCompositorMsg, TimerEvent, TimerEventId, TimerEventRequest, TimerSource}; +use script_traits::{DocumentState, MsDuration, ScriptToCompositorMsg, TimerEvent, TimerEventId}; +use script_traits::{TimerEventRequest, TimerSource}; use selectors::parser::PseudoElement; use std::ascii::AsciiExt; use std::borrow::ToOwned; diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index fa27f37bd23..64e64e64ed9 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -147,6 +147,15 @@ pub enum ConstellationControlMsg { ReportCSSError(PipelineId, String, u32, u32, String), } +/// Used to determine if a script has any pending asynchronous activity. +#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Serialize)] +pub enum DocumentState { + /// The document has been loaded and is idle. + Idle, + /// The document is either loading or waiting on an event. + Pending, +} + /// 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 5d392f016c8..195976806a6 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -2,13 +2,14 @@ * 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 DocumentState; use IFrameLoadInfo; use MouseEventType; use canvas_traits::CanvasMsg; use euclid::point::Point2D; use euclid::size::Size2D; use ipc_channel::ipc::IpcSender; -use msg::constellation_msg::{AnimationState, DocumentState, NavigationDirection}; +use msg::constellation_msg::{AnimationState, NavigationDirection}; use msg::constellation_msg::{Failure, MozBrowserEvent, PipelineId}; use msg::constellation_msg::{LoadData, MouseButton, SubpageId}; use offscreen_gl_context::GLContextAttributes;