aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/compositing/constellation.rs3
-rw-r--r--components/compositing/pipeline.rs5
-rw-r--r--components/layout/animation.rs3
-rw-r--r--components/layout/layout_task.rs2
-rw-r--r--components/layout/query.rs2
-rw-r--r--components/layout_traits/lib.rs2
-rw-r--r--components/msg/Cargo.toml10
-rw-r--r--components/msg/constellation_msg.rs53
-rw-r--r--components/msg/lib.rs3
-rw-r--r--components/script/clipboard_provider.rs2
-rw-r--r--components/script/dom/bindings/global.rs3
-rw-r--r--components/script/dom/bindings/trace.rs4
-rw-r--r--components/script/dom/canvasrenderingcontext2d.rs2
-rw-r--r--components/script/dom/document.rs3
-rw-r--r--components/script/dom/htmlbodyelement.rs2
-rw-r--r--components/script/dom/htmliframeelement.rs2
-rw-r--r--components/script/dom/htmlinputelement.rs2
-rw-r--r--components/script/dom/htmllinkelement.rs2
-rw-r--r--components/script/dom/htmltextareaelement.rs2
-rw-r--r--components/script/dom/webglrenderingcontext.rs2
-rw-r--r--components/script/dom/window.rs2
-rw-r--r--components/script/dom/workerglobalscope.rs2
-rw-r--r--components/script/layout_interface.rs5
-rw-r--r--components/script/script_task.rs5
-rw-r--r--components/script_traits/Cargo.toml10
-rw-r--r--components/script_traits/lib.rs10
-rw-r--r--components/script_traits/script_msg.rs69
-rw-r--r--components/servo/Cargo.lock6
-rw-r--r--ports/cef/Cargo.lock6
-rw-r--r--ports/gonk/Cargo.lock6
30 files changed, 121 insertions, 109 deletions
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs
index 7013d9250de..01cd79ca6ef 100644
--- a/components/compositing/constellation.rs
+++ b/components/compositing/constellation.rs
@@ -28,7 +28,6 @@ use msg::compositor_msg::Epoch;
use msg::constellation_msg::AnimationState;
use msg::constellation_msg::CompositorMsg as FromCompositorMsg;
use msg::constellation_msg::PaintMsg as FromPaintMsg;
-use msg::constellation_msg::ScriptMsg as FromScriptMsg;
use msg::constellation_msg::WebDriverCommandMsg;
use msg::constellation_msg::{FrameId, PipelineId};
use msg::constellation_msg::{IframeLoadInfo, IFrameSandboxState, MozBrowserEvent, NavigationDirection};
@@ -46,7 +45,7 @@ use profile_traits::mem;
use profile_traits::time;
use sandboxing;
use script_traits::{CompositorEvent, ConstellationControlMsg, LayoutControlMsg};
-use script_traits::{ScriptState, ScriptTaskFactory};
+use script_traits::{ScriptMsg as FromScriptMsg, ScriptState, ScriptTaskFactory};
use script_traits::{TimerEventRequest};
use std::borrow::ToOwned;
use std::collections::HashMap;
diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs
index c32e1f12cd0..ffcb915153c 100644
--- a/components/compositing/pipeline.rs
+++ b/components/compositing/pipeline.rs
@@ -16,7 +16,6 @@ use layers::geometry::DevicePixel;
use layout_traits::{LayoutControlChan, LayoutTaskFactory};
use msg::compositor_msg::ScriptToCompositorMsg;
use msg::constellation_msg::PaintMsg;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId};
use msg::constellation_msg::{LoadData, MozBrowserEvent, WindowSizeData};
use msg::constellation_msg::{PipelineNamespaceId};
@@ -26,8 +25,8 @@ use net_traits::storage_task::StorageTask;
use profile_traits::mem as profile_mem;
use profile_traits::time;
use script_traits::{ConstellationControlMsg, InitialScriptState};
-use script_traits::{LayoutControlMsg, NewLayoutInfo, ScriptTaskFactory};
-use script_traits::{TimerEventRequest};
+use script_traits::{LayoutControlMsg, NewLayoutInfo, ScriptMsg as ConstellationMsg};
+use script_traits::{ScriptTaskFactory, TimerEventRequest};
use std::mem;
use std::sync::mpsc::{Receiver, Sender, channel};
use std::thread;
diff --git a/components/layout/animation.rs b/components/layout/animation.rs
index fc8c9aa7002..628b693a2c0 100644
--- a/components/layout/animation.rs
+++ b/components/layout/animation.rs
@@ -7,9 +7,9 @@
use flow::{self, Flow};
use gfx::display_list::OpaqueNode;
use incremental::{self, RestyleDamage};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{AnimationState, ConstellationChan, PipelineId};
use script::layout_interface::Animation;
+use script_traits::ScriptMsg as ConstellationMsg;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::sync::mpsc::{Sender, Receiver};
@@ -162,4 +162,3 @@ pub fn update_style_for_animation(animation: &Animation,
*style = new_style
}
-
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index cf7ca56da00..b1cad3cbd4a 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -35,7 +35,6 @@ use layout_debug;
use layout_traits::LayoutTaskFactory;
use log;
use msg::compositor_msg::{Epoch, LayerId, ScrollPolicy};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheResult, ImageCacheTask};
use parallel::{self, WorkQueueData};
@@ -50,6 +49,7 @@ use script::layout_interface::{LayoutRPC, OffsetParentResponse};
use script::layout_interface::{Msg, NewLayoutTaskInfo, Reflow, ReflowGoal, ReflowQueryType};
use script::layout_interface::{ScriptLayoutChan, ScriptReflow};
use script::reporter::CSSErrorReporter;
+use script_traits::ScriptMsg as ConstellationMsg;
use script_traits::{ConstellationControlMsg, LayoutControlMsg, OpaqueScriptLayoutChannel};
use sequential;
use serde_json;
diff --git a/components/layout/query.rs b/components/layout/query.rs
index 68b454b4cba..83f758b0f50 100644
--- a/components/layout/query.rs
+++ b/components/layout/query.rs
@@ -14,11 +14,11 @@ use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use gfx::display_list::{DisplayItemMetadata, OpaqueNode};
use layout_task::LayoutTaskData;
use msg::constellation_msg::ConstellationChan;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use opaque_node::OpaqueNodeMethods;
use script::layout_interface::{ContentBoxResponse, ContentBoxesResponse, NodeGeometryResponse};
use script::layout_interface::{HitTestResponse, LayoutRPC, MouseOverResponse, OffsetParentResponse};
use script::layout_interface::{ResolvedStyleResponse, ScriptLayoutChan};
+use script_traits::ScriptMsg as ConstellationMsg;
use selectors::parser::PseudoElement;
use sequential;
use std::ops::Deref;
diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs
index bbcb1d612d8..f595e0a7f16 100644
--- a/components/layout_traits/lib.rs
+++ b/components/layout_traits/lib.rs
@@ -24,10 +24,10 @@ extern crate util;
use gfx::font_cache_task::FontCacheTask;
use gfx::paint_task::LayoutToPaintMsg;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use net_traits::image_cache_task::ImageCacheTask;
use profile_traits::{mem, time};
+use script_traits::ScriptMsg as ConstellationMsg;
use script_traits::{LayoutControlMsg, ConstellationControlMsg, OpaqueScriptLayoutChannel};
use url::Url;
use util::ipc::OptionalIpcSender;
diff --git a/components/msg/Cargo.toml b/components/msg/Cargo.toml
index f933b405b1e..74106e9eaba 100644
--- a/components/msg/Cargo.toml
+++ b/components/msg/Cargo.toml
@@ -10,12 +10,6 @@ path = "lib.rs"
[dependencies.util]
path = "../util"
-[dependencies.canvas_traits]
-path = "../canvas_traits"
-
-[dependencies.style_traits]
-path = "../style_traits"
-
[dependencies.azure]
git = "https://github.com/servo/rust-azure"
features = ["plugins"]
@@ -27,10 +21,6 @@ features = ["plugins"]
[dependencies.ipc-channel]
git = "https://github.com/servo/ipc-channel"
-[dependencies.offscreen_gl_context]
-git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
-features = ["texture_surface"]
-
[dependencies.plugins]
path = "../plugins"
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs
index 139a77bc4fb..0edf9c38075 100644
--- a/components/msg/constellation_msg.rs
+++ b/components/msg/constellation_msg.rs
@@ -5,24 +5,19 @@
//! The high-level interface from script to constellation. Using this abstract interface helps
//! reduce coupling between these two components.
-use canvas_traits::CanvasMsg;
use compositor_msg::Epoch;
-use euclid::point::Point2D;
use euclid::scale_factor::ScaleFactor;
use euclid::size::{Size2D, TypedSize2D};
use hyper::header::Headers;
use hyper::method::Method;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender, IpcSharedMemory};
use layers::geometry::DevicePixel;
-use offscreen_gl_context::GLContextAttributes;
use serde::{Deserialize, Serialize};
use std::cell::Cell;
use std::collections::HashMap;
use std::fmt;
use std::sync::mpsc::channel;
-use style_traits::viewport::ViewportConstraints;
use url::Url;
-use util::cursor::Cursor;
use util::geometry::{PagePx, ViewportPx};
use util::mem::HeapSizeOf;
use webdriver_msg::{LoadStatus, WebDriverScriptCommand};
@@ -257,54 +252,6 @@ pub enum CompositorMsg {
WebDriverCommand(WebDriverCommandMsg),
}
-/// Messages from the script to the constellation.
-#[derive(Deserialize, Serialize)]
-pub enum ScriptMsg {
- /// Indicates whether this pipeline is currently running animations.
- ChangeRunningAnimationsState(PipelineId, AnimationState),
- /// Requests that a new 2D canvas thread be created. (This is done in the constellation because
- /// 2D canvases may use the GPU and we don't want to give untrusted content access to the GPU.)
- CreateCanvasPaintTask(Size2D<i32>, IpcSender<(IpcSender<CanvasMsg>, usize)>),
- /// Requests that a new WebGL thread be created. (This is done in the constellation because
- /// WebGL uses the GPU and we don't want to give untrusted content access to the GPU.)
- CreateWebGLPaintTask(Size2D<i32>,
- GLContextAttributes,
- IpcSender<Result<(IpcSender<CanvasMsg>, usize), String>>),
- /// Dispatched after the DOM load event has fired on a document
- /// Causes a `load` event to be dispatched to any enclosing frame context element
- /// for the given pipeline.
- DOMLoad(PipelineId),
- Failure(Failure),
- /// Notifies the constellation that this frame has received focus.
- Focus(PipelineId),
- /// Re-send a mouse button event that was sent to the parent window.
- ForwardMouseButtonEvent(PipelineId, MouseEventType, MouseButton, Point2D<f32>),
- /// Re-send a mouse move event that was sent to the parent window.
- ForwardMouseMoveEvent(PipelineId, Point2D<f32>),
- /// Requests that the constellation retrieve the current contents of the clipboard
- GetClipboardContents(IpcSender<String>),
- /// <head> tag finished parsing
- HeadParsed,
- LoadComplete(PipelineId),
- LoadUrl(PipelineId, LoadData),
- /// Dispatch a mozbrowser event to a given iframe. Only available in experimental mode.
- MozBrowserEvent(PipelineId, SubpageId, MozBrowserEvent),
- Navigate(Option<(PipelineId, SubpageId)>, NavigationDirection),
- /// Favicon detected
- NewFavicon(Url),
- /// Status message to be displayed in the chrome, eg. a link URL on mouseover.
- NodeStatus(Option<String>),
- /// Notification that this iframe should be removed.
- RemoveIFrame(PipelineId),
- ScriptLoadedURLInIFrame(IframeLoadInfo),
- /// Requests that the constellation set the contents of the clipboard
- SetClipboardContents(String),
- /// Requests that the constellation inform the compositor of the a cursor change.
- SetCursor(Cursor),
- /// Notifies the constellation that the viewport has been constrained in some manner
- ViewportConstrained(PipelineId, ViewportConstraints),
-}
-
#[derive(Deserialize, HeapSizeOf, Serialize)]
pub enum MouseEventType {
Click,
diff --git a/components/msg/lib.rs b/components/msg/lib.rs
index c989835e7ea..ca8383225fd 100644
--- a/components/msg/lib.rs
+++ b/components/msg/lib.rs
@@ -9,7 +9,6 @@ extern crate app_units;
extern crate azure;
#[macro_use]
extern crate bitflags;
-extern crate canvas_traits;
#[cfg(target_os = "macos")]
extern crate core_foundation;
extern crate euclid;
@@ -18,10 +17,8 @@ extern crate hyper;
extern crate io_surface;
extern crate ipc_channel;
extern crate layers;
-extern crate offscreen_gl_context;
extern crate rustc_serialize;
extern crate serde;
-extern crate style_traits;
extern crate url;
extern crate util;
diff --git a/components/script/clipboard_provider.rs b/components/script/clipboard_provider.rs
index 87e168ed288..5c88a72aad4 100644
--- a/components/script/clipboard_provider.rs
+++ b/components/script/clipboard_provider.rs
@@ -4,7 +4,7 @@
use ipc_channel::ipc;
use msg::constellation_msg::ConstellationChan;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
+use script_traits::ScriptMsg as ConstellationMsg;
use std::borrow::ToOwned;
use std::sync::mpsc::channel;
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs
index aaa37c5292c..d3ece2ae98e 100644
--- a/components/script/dom/bindings/global.rs
+++ b/components/script/dom/bindings/global.rs
@@ -18,12 +18,11 @@ use ipc_channel::ipc::IpcSender;
use js::jsapi::GetGlobalForObjectCrossCompartment;
use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue};
use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, PipelineId};
use net_traits::ResourceTask;
use profile_traits::mem;
use script_task::{CommonScriptMsg, ScriptChan, ScriptPort, ScriptTask};
-use script_traits::{MsDuration, TimerEventRequest};
+use script_traits::{MsDuration, ScriptMsg as ConstellationMsg, TimerEventRequest};
use timers::{ScheduledCallback, TimerHandle};
use url::Url;
use util::mem::HeapSizeOf;
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 8c4a20d643a..cbe870f073c 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -54,7 +54,7 @@ use js::jsval::JSVal;
use js::rust::Runtime;
use layout_interface::{LayoutChan, LayoutRPC};
use libc;
-use msg::constellation_msg::{ConstellationChan, ScriptMsg};
+use msg::constellation_msg::ConstellationChan;
use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData};
use net_traits::Metadata;
use net_traits::image::base::Image;
@@ -63,7 +63,7 @@ use net_traits::storage_task::StorageType;
use profile_traits::mem::ProfilerChan as MemProfilerChan;
use profile_traits::time::ProfilerChan as TimeProfilerChan;
use script_task::ScriptChan;
-use script_traits::{TimerEventId, TimerSource, UntrustedNodeAddress};
+use script_traits::{ScriptMsg, TimerEventId, TimerSource, UntrustedNodeAddress};
use selectors::parser::PseudoElement;
use selectors::states::*;
use serde::{Deserialize, Serialize};
diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs
index 119f819cf8e..22e1c388f59 100644
--- a/components/script/dom/canvasrenderingcontext2d.rs
+++ b/components/script/dom/canvasrenderingcontext2d.rs
@@ -35,10 +35,10 @@ use euclid::point::Point2D;
use euclid::rect::Rect;
use euclid::size::Size2D;
use ipc_channel::ipc::{self, IpcSender};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use net_traits::image::base::PixelFormat;
use net_traits::image_cache_task::ImageResponse;
use num::{Float, ToPrimitive};
+use script_traits::ScriptMsg as ConstellationMsg;
use std::str::FromStr;
use std::sync::mpsc::channel;
use std::{cmp, fmt};
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 7b375e34129..b816624b10c 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -81,7 +81,6 @@ use layout_interface::{HitTestResponse, MouseOverResponse};
use layout_interface::{LayoutChan, Msg};
use layout_interface::{ReflowGoal, ReflowQueryType};
use msg::compositor_msg::ScriptToCompositorMsg;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
use msg::constellation_msg::{AnimationState, PipelineId};
use msg::constellation_msg::{ConstellationChan, Key, KeyModifiers, KeyState};
@@ -91,7 +90,7 @@ use net_traits::CookieSource::NonHTTP;
use net_traits::{AsyncResponseTarget, PendingAsyncLoad};
use num::ToPrimitive;
use script_task::{MainThreadScriptMsg, Runnable};
-use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress};
+use script_traits::{ScriptMsg as ConstellationMsg, TouchEventType, TouchId, UntrustedNodeAddress};
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::boxed::FnBox;
diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs
index f7605ed5aa3..79c549fd55d 100644
--- a/components/script/dom/htmlbodyelement.rs
+++ b/components/script/dom/htmlbodyelement.rs
@@ -18,7 +18,7 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, document_from_node, window_from_node};
use dom::virtualmethods::VirtualMethods;
use msg::constellation_msg::ConstellationChan;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
+use script_traits::ScriptMsg as ConstellationMsg;
use std::rc::Rc;
use string_cache::Atom;
use time;
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 3798ab4f539..7039340ead2 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -25,10 +25,10 @@ use dom::window::Window;
use js::jsapi::{JSAutoCompartment, JSAutoRequest, RootedValue, JSContext, MutableHandleValue};
use js::jsval::{UndefinedValue, NullValue};
use msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, IframeLoadInfo, MozBrowserEvent};
use msg::constellation_msg::{NavigationDirection, PipelineId, SubpageId};
use page::IterablePage;
+use script_traits::ScriptMsg as ConstellationMsg;
use std::ascii::AsciiExt;
use std::cell::Cell;
use string_cache::Atom;
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index cd640b83287..6c3e9cdfb56 100644
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -28,7 +28,7 @@ use dom::node::{document_from_node, window_from_node};
use dom::nodelist::NodeList;
use dom::virtualmethods::VirtualMethods;
use msg::constellation_msg::ConstellationChan;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
+use script_traits::ScriptMsg as ConstellationMsg;
use selectors::states::*;
use std::borrow::ToOwned;
use std::cell::Cell;
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs
index 3ded045c834..d302430d756 100644
--- a/components/script/dom/htmllinkelement.rs
+++ b/components/script/dom/htmllinkelement.rs
@@ -24,10 +24,10 @@ use encoding::all::UTF_8;
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use layout_interface::{LayoutChan, Msg};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, MozBrowserEvent};
use net_traits::{AsyncResponseListener, AsyncResponseTarget, Metadata};
use network_listener::{NetworkListener, PreInvoke};
+use script_traits::ScriptMsg as ConstellationMsg;
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::cell::Cell;
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index 12d0a47a6c8..1c77d98f69d 100644
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -25,9 +25,9 @@ use dom::node::{document_from_node, window_from_node};
use dom::nodelist::NodeList;
use dom::virtualmethods::VirtualMethods;
use msg::constellation_msg::ConstellationChan;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use script_task::ScriptTaskEventCategory::InputEvent;
use script_task::{CommonScriptMsg, Runnable};
+use script_traits::ScriptMsg as ConstellationMsg;
use selectors::states::*;
use std::cell::Cell;
use string_cache::Atom;
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index eecfeceee15..e9a8b922a48 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -31,10 +31,10 @@ use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::{JSContext, JSObject, RootedValue};
use js::jsapi::{JS_GetFloat32ArrayData, JS_GetObjectAsArrayBufferView};
use js::jsval::{BooleanValue, Int32Value, JSVal, NullValue, UndefinedValue};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use net_traits::image::base::PixelFormat;
use net_traits::image_cache_task::ImageResponse;
use offscreen_gl_context::GLContextAttributes;
+use script_traits::ScriptMsg as ConstellationMsg;
use std::cell::Cell;
use std::sync::mpsc::channel;
use std::{ptr, slice};
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 41201082e7f..fd471cc4d38 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -43,7 +43,6 @@ use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleRe
use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowGoal, ReflowQueryType};
use libc;
use msg::compositor_msg::{LayerId, ScriptToCompositorMsg};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, LoadData, PipelineId, SubpageId, WindowSizeData};
use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
use net_traits::ResourceTask;
@@ -56,6 +55,7 @@ use reporter::CSSErrorReporter;
use rustc_serialize::base64::{FromBase64, STANDARD, ToBase64};
use script_task::{ScriptChan, ScriptPort, MainThreadScriptMsg, RunnableWrapper};
use script_task::{SendableMainThreadScriptChan, MainThreadScriptChan};
+use script_traits::ScriptMsg as ConstellationMsg;
use script_traits::{MsDuration, TimerEvent, TimerEventId, TimerEventRequest, TimerSource};
use selectors::parser::PseudoElement;
use std::ascii::AsciiExt;
diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs
index bef4f3547a1..7df9b312df5 100644
--- a/components/script/dom/workerglobalscope.rs
+++ b/components/script/dom/workerglobalscope.rs
@@ -20,11 +20,11 @@ use dom::workernavigator::WorkerNavigator;
use ipc_channel::ipc::IpcSender;
use js::jsapi::{HandleValue, JSAutoRequest, JSContext};
use js::rust::Runtime;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, PipelineId};
use net_traits::{ResourceTask, load_whole_resource};
use profile_traits::mem;
use script_task::{CommonScriptMsg, ScriptChan, ScriptPort};
+use script_traits::ScriptMsg as ConstellationMsg;
use script_traits::{MsDuration, TimerEvent, TimerEventId, TimerEventRequest, TimerSource};
use std::cell::Cell;
use std::default::Default;
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs
index 4a78e23e23c..a38385cebb3 100644
--- a/components/script/layout_interface.rs
+++ b/components/script/layout_interface.rs
@@ -14,13 +14,12 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender};
use libc::uintptr_t;
use msg::compositor_msg::Epoch;
use msg::compositor_msg::LayerId;
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use msg::constellation_msg::{WindowSizeData};
use net_traits::image_cache_task::ImageCacheTask;
use profile_traits::mem::ReportsChan;
-use script_traits::{ConstellationControlMsg, LayoutControlMsg};
-use script_traits::{OpaqueScriptLayoutChannel, UntrustedNodeAddress};
+use script_traits::{ConstellationControlMsg, LayoutControlMsg, OpaqueScriptLayoutChannel};
+use script_traits::{ScriptMsg as ConstellationMsg, UntrustedNodeAddress};
use selectors::parser::PseudoElement;
use std::any::Any;
use std::sync::Arc;
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index f0ea6bd1354..1dcf707a735 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -62,7 +62,6 @@ use layout_interface::{self, LayoutChan, NewLayoutTaskInfo, ReflowGoal, ScriptLa
use libc;
use mem::heap_size_of_self_and_children;
use msg::compositor_msg::{EventResult, LayerId, ScriptToCompositorMsg};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, LoadData};
use msg::constellation_msg::{MouseButton, MouseEventType, MozBrowserEvent, PipelineId};
use msg::constellation_msg::{PipelineNamespace};
@@ -81,8 +80,8 @@ use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent};
use script_traits::CompositorEvent::{TouchEvent};
use script_traits::{CompositorEvent, ConstellationControlMsg, InitialScriptState, NewLayoutInfo};
-use script_traits::{OpaqueScriptLayoutChannel, ScriptState, ScriptTaskFactory};
-use script_traits::{TimerEvent, TimerEventRequest, TimerSource};
+use script_traits::{OpaqueScriptLayoutChannel, ScriptMsg as ConstellationMsg, ScriptState};
+use script_traits::{ScriptTaskFactory, TimerEvent, TimerEventRequest, TimerSource};
use script_traits::{TouchEventType, TouchId};
use std::any::Any;
use std::borrow::ToOwned;
diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml
index 4181c32508c..c0017f26bf8 100644
--- a/components/script_traits/Cargo.toml
+++ b/components/script_traits/Cargo.toml
@@ -7,18 +7,28 @@ authors = ["The Servo Project Developers"]
name = "script_traits"
path = "lib.rs"
+[dependencies.canvas_traits]
+path = "../canvas_traits"
+
[dependencies.msg]
path = "../msg"
[dependencies.net_traits]
path = "../net_traits"
+[dependencies.offscreen_gl_context]
+git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
+features = ["texture_surface"]
+
[dependencies.plugins]
path = "../plugins"
[dependencies.profile_traits]
path = "../profile_traits"
+[dependencies.style_traits]
+path = "../style_traits"
+
[dependencies.util]
path = "../util"
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index ef86ee26085..09aeef32785 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -11,18 +11,23 @@
#![deny(missing_docs)]
extern crate app_units;
+extern crate canvas_traits;
extern crate devtools_traits;
extern crate euclid;
extern crate ipc_channel;
extern crate libc;
extern crate msg;
extern crate net_traits;
+extern crate offscreen_gl_context;
extern crate profile_traits;
extern crate serde;
+extern crate style_traits;
extern crate time;
extern crate url;
extern crate util;
+mod script_msg;
+
use app_units::Au;
use devtools_traits::ScriptToDevtoolsControlMsg;
use euclid::length::Length;
@@ -31,7 +36,6 @@ use euclid::rect::Rect;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use libc::c_void;
use msg::compositor_msg::{Epoch, LayerId, ScriptToCompositorMsg};
-use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, SubpageId};
use msg::constellation_msg::{MouseButton, MouseEventType};
@@ -45,6 +49,8 @@ use std::any::Any;
use util::ipc::OptionalOpaqueIpcSender;
use util::mem::HeapSizeOf;
+pub use script_msg::ScriptMsg;
+
/// The address of a node. Layout sends these back. They must be validated via
/// `from_untrusted_node_address` before they can be used, because we do not trust layout.
#[derive(Copy, Clone, Debug)]
@@ -249,7 +255,7 @@ pub struct InitialScriptState {
/// A port on which messages sent by the constellation to script can be received.
pub control_port: IpcReceiver<ConstellationControlMsg>,
/// A channel on which messages can be sent to the constellation from script.
- pub constellation_chan: ConstellationChan<ConstellationMsg>,
+ pub constellation_chan: ConstellationChan<ScriptMsg>,
/// A channel to schedule timer events.
pub scheduler_chan: IpcSender<TimerEventRequest>,
/// Information that script sends out when it panics.
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
new file mode 100644
index 00000000000..7769dbe8597
--- /dev/null
+++ b/components/script_traits/script_msg.rs
@@ -0,0 +1,69 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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 canvas_traits::CanvasMsg;
+use euclid::point::Point2D;
+use euclid::size::Size2D;
+use ipc_channel::ipc::IpcSender;
+use msg::constellation_msg::{AnimationState, IframeLoadInfo, NavigationDirection};
+use msg::constellation_msg::{Failure, MozBrowserEvent, PipelineId};
+use msg::constellation_msg::{LoadData, SubpageId};
+use msg::constellation_msg::{MouseButton, MouseEventType};
+use offscreen_gl_context::GLContextAttributes;
+use style_traits::viewport::ViewportConstraints;
+use url::Url;
+use util::cursor::Cursor;
+
+/// Messages from the script to the constellation.
+#[derive(Deserialize, Serialize)]
+pub enum ScriptMsg {
+ /// Indicates whether this pipeline is currently running animations.
+ ChangeRunningAnimationsState(PipelineId, AnimationState),
+ /// Requests that a new 2D canvas thread be created. (This is done in the constellation because
+ /// 2D canvases may use the GPU and we don't want to give untrusted content access to the GPU.)
+ CreateCanvasPaintTask(Size2D<i32>, IpcSender<(IpcSender<CanvasMsg>, usize)>),
+ /// Requests that a new WebGL thread be created. (This is done in the constellation because
+ /// WebGL uses the GPU and we don't want to give untrusted content access to the GPU.)
+ CreateWebGLPaintTask(Size2D<i32>,
+ GLContextAttributes,
+ IpcSender<Result<(IpcSender<CanvasMsg>, usize), String>>),
+ /// Dispatched after the DOM load event has fired on a document
+ /// Causes a `load` event to be dispatched to any enclosing frame context element
+ /// for the given pipeline.
+ DOMLoad(PipelineId),
+ /// Script task failure.
+ Failure(Failure),
+ /// Notifies the constellation that this frame has received focus.
+ Focus(PipelineId),
+ /// Re-send a mouse button event that was sent to the parent window.
+ ForwardMouseButtonEvent(PipelineId, MouseEventType, MouseButton, Point2D<f32>),
+ /// Re-send a mouse move event that was sent to the parent window.
+ ForwardMouseMoveEvent(PipelineId, Point2D<f32>),
+ /// Requests that the constellation retrieve the current contents of the clipboard
+ GetClipboardContents(IpcSender<String>),
+ /// <head> tag finished parsing
+ HeadParsed,
+ /// All pending loads are complete.
+ LoadComplete(PipelineId),
+ /// A new load has been requested.
+ LoadUrl(PipelineId, LoadData),
+ /// Dispatch a mozbrowser event to a given iframe. Only available in experimental mode.
+ MozBrowserEvent(PipelineId, SubpageId, MozBrowserEvent),
+ /// HTMLIFrameElement Forward or Back navigation.
+ Navigate(Option<(PipelineId, SubpageId)>, NavigationDirection),
+ /// Favicon detected
+ NewFavicon(Url),
+ /// Status message to be displayed in the chrome, eg. a link URL on mouseover.
+ NodeStatus(Option<String>),
+ /// Notification that this iframe should be removed.
+ RemoveIFrame(PipelineId),
+ /// A load has been requested in an IFrame.
+ ScriptLoadedURLInIFrame(IframeLoadInfo),
+ /// Requests that the constellation set the contents of the clipboard
+ SetClipboardContents(String),
+ /// Requests that the constellation inform the compositor of the a cursor change.
+ SetCursor(Cursor),
+ /// Notifies the constellation that the viewport has been constrained in some manner
+ ViewportConstrained(PipelineId, ViewportConstraints),
+}
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index c77773b52ae..eee445dfe71 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -1112,19 +1112,16 @@ dependencies = [
"app_units 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.2.1 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "canvas_traits 0.0.1",
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.0 (git+https://github.com/servo/rust-layers)",
- "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "style_traits 0.0.1",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -1551,16 +1548,19 @@ name = "script_traits"
version = "0.0.1"
dependencies = [
"app_units 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "canvas_traits 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
+ "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "style_traits 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index ce4b2c17921..3c4a716228a 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -1072,19 +1072,16 @@ dependencies = [
"app_units 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.2.1 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "canvas_traits 0.0.1",
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.0 (git+https://github.com/servo/rust-layers)",
- "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "style_traits 0.0.1",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -1467,16 +1464,19 @@ name = "script_traits"
version = "0.0.1"
dependencies = [
"app_units 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "canvas_traits 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
+ "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "style_traits 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock
index 9d6127f77c9..1f74a6bb2ab 100644
--- a/ports/gonk/Cargo.lock
+++ b/ports/gonk/Cargo.lock
@@ -1048,19 +1048,16 @@ dependencies = [
"app_units 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.2.1 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "canvas_traits 0.0.1",
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.0 (git+https://github.com/servo/rust-layers)",
- "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "style_traits 0.0.1",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -1443,16 +1440,19 @@ name = "script_traits"
version = "0.0.1"
dependencies = [
"app_units 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "canvas_traits 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
+ "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "style_traits 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",