Move DocumentState to script_traits

Fixes #9224.
This commit is contained in:
Brandon Fairchild 2016-01-12 13:30:33 -05:00
parent e977a6e69a
commit d1186eda7a
5 changed files with 16 additions and 14 deletions

View file

@ -28,7 +28,7 @@ use ipc_channel::router::ROUTER;
use layout_traits::{LayoutControlChan, LayoutThreadFactory}; use layout_traits::{LayoutControlChan, LayoutThreadFactory};
use msg::constellation_msg::AnimationState; use msg::constellation_msg::AnimationState;
use msg::constellation_msg::WebDriverCommandMsg; 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::{Key, KeyModifiers, KeyState, LoadData};
use msg::constellation_msg::{MozBrowserEvent, NavigationDirection}; use msg::constellation_msg::{MozBrowserEvent, NavigationDirection};
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId}; use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId};
@ -43,7 +43,7 @@ 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, LayoutControlMsg}; use script_traits::{CompositorEvent, ConstellationControlMsg, DocumentState, LayoutControlMsg};
use script_traits::{IFrameLoadInfo, IFrameSandboxState}; use script_traits::{IFrameLoadInfo, IFrameSandboxState};
use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory}; use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory};
use script_traits::{TimerEventRequest}; use script_traits::{TimerEventRequest};

View file

@ -219,15 +219,6 @@ pub enum AnimationState {
NoAnimationCallbacksPresent, 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 // https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API#Events
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub enum MozBrowserEvent { pub enum MozBrowserEvent {

View file

@ -43,7 +43,7 @@ use js::rust::Runtime;
use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow};
use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowQueryType}; use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowQueryType};
use libc; 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::constellation_msg::{MozBrowserEvent, PipelineId, SubpageId, WindowSizeData};
use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
use net_traits::ResourceThread; use net_traits::ResourceThread;
@ -58,7 +58,8 @@ use script_thread::{DOMManipulationThreadSource, UserInteractionThreadSource, Ne
use script_thread::{HistoryTraversalThreadSource, FileReadingThreadSource, SendableMainThreadScriptChan}; use script_thread::{HistoryTraversalThreadSource, FileReadingThreadSource, SendableMainThreadScriptChan};
use script_thread::{ScriptChan, ScriptPort, MainThreadScriptChan, MainThreadScriptMsg, RunnableWrapper}; use script_thread::{ScriptChan, ScriptPort, MainThreadScriptChan, MainThreadScriptMsg, RunnableWrapper};
use script_traits::ScriptMsg as ConstellationMsg; 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 selectors::parser::PseudoElement;
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
use std::borrow::ToOwned; use std::borrow::ToOwned;

View file

@ -147,6 +147,15 @@ pub enum ConstellationControlMsg {
ReportCSSError(PipelineId, String, u32, u32, String), 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. /// 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,13 +2,14 @@
* 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 DocumentState;
use IFrameLoadInfo; use IFrameLoadInfo;
use MouseEventType; use MouseEventType;
use canvas_traits::CanvasMsg; 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, DocumentState, NavigationDirection}; use msg::constellation_msg::{AnimationState, NavigationDirection};
use msg::constellation_msg::{Failure, MozBrowserEvent, PipelineId}; use msg::constellation_msg::{Failure, MozBrowserEvent, 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;