Skip to content

Commit

Permalink
Move DocumentState to script_traits
Browse files Browse the repository at this point in the history
Fixes #9224.
  • Loading branch information
nerith committed Jan 12, 2016
1 parent e977a6e commit d1186ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions components/compositing/constellation.rs
Expand Up @@ -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};
Expand All @@ -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};
Expand Down
9 changes: 0 additions & 9 deletions components/msg/constellation_msg.rs
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions components/script/dom/window.rs
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions components/script_traits/lib.rs
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion components/script_traits/script_msg.rs
Expand Up @@ -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;
Expand Down

0 comments on commit d1186ed

Please sign in to comment.