servo: Merge #8909 - Move ScriptMsg to script_traits crate, Fixes #8833 (from cnaj:msg_refactoring); r=jdm
Review of documentation that was missing needed. Fixes #8833. Source-Repo: https://github.com/servo/servo Source-Revision: 7438bc0425749989b8aab084a34ff3fff2ea6679
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user