mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
move ConstellationMsg to compositing
This commit is contained in:
parent
b3ac17b82f
commit
8d4aeef08b
15 changed files with 133 additions and 122 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -779,6 +779,7 @@ dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"pixels",
|
"pixels",
|
||||||
"profile_traits",
|
"profile_traits",
|
||||||
|
"rust-webvr",
|
||||||
"script_traits",
|
"script_traits",
|
||||||
"servo-media",
|
"servo-media",
|
||||||
"servo_geometry",
|
"servo_geometry",
|
||||||
|
@ -788,7 +789,6 @@ dependencies = [
|
||||||
"toml",
|
"toml",
|
||||||
"webrender",
|
"webrender",
|
||||||
"webrender_api",
|
"webrender_api",
|
||||||
"webvr",
|
|
||||||
"webvr_traits",
|
"webvr_traits",
|
||||||
"webxr",
|
"webxr",
|
||||||
]
|
]
|
||||||
|
@ -6585,6 +6585,7 @@ name = "webdriver_server"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
|
"compositing",
|
||||||
"cookie",
|
"cookie",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
"euclid",
|
"euclid",
|
||||||
|
@ -6703,6 +6704,7 @@ name = "webvr"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"canvas_traits",
|
"canvas_traits",
|
||||||
|
"compositing",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
"euclid",
|
"euclid",
|
||||||
"ipc-channel",
|
"ipc-channel",
|
||||||
|
@ -6710,7 +6712,6 @@ dependencies = [
|
||||||
"msg",
|
"msg",
|
||||||
"rust-webvr",
|
"rust-webvr",
|
||||||
"rust-webvr-api",
|
"rust-webvr-api",
|
||||||
"script_traits",
|
|
||||||
"servo_config",
|
"servo_config",
|
||||||
"sparkle",
|
"sparkle",
|
||||||
"webvr_traits",
|
"webvr_traits",
|
||||||
|
|
|
@ -31,6 +31,7 @@ net_traits = {path = "../net_traits"}
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
pixels = {path = "../pixels", optional = true}
|
pixels = {path = "../pixels", optional = true}
|
||||||
profile_traits = {path = "../profile_traits"}
|
profile_traits = {path = "../profile_traits"}
|
||||||
|
rust-webvr = {version = "0.16", features = ["mock", "openvr", "vrexternal"]}
|
||||||
script_traits = {path = "../script_traits"}
|
script_traits = {path = "../script_traits"}
|
||||||
servo_geometry = {path = "../geometry"}
|
servo_geometry = {path = "../geometry"}
|
||||||
servo-media = {git = "https://github.com/servo/media"}
|
servo-media = {git = "https://github.com/servo/media"}
|
||||||
|
@ -40,7 +41,6 @@ time = "0.1.17"
|
||||||
webrender = {git = "https://github.com/servo/webrender", features = ["capture"]}
|
webrender = {git = "https://github.com/servo/webrender", features = ["capture"]}
|
||||||
webrender_api = {git = "https://github.com/servo/webrender"}
|
webrender_api = {git = "https://github.com/servo/webrender"}
|
||||||
webvr_traits = {path = "../webvr_traits"}
|
webvr_traits = {path = "../webvr_traits"}
|
||||||
webvr = {path = "../webvr"}
|
|
||||||
webxr = {git = "https://github.com/servo/webxr"}
|
webxr = {git = "https://github.com/servo/webxr"}
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|
|
@ -10,8 +10,7 @@ use crate::touch::{TouchAction, TouchHandler};
|
||||||
use crate::windowing::{
|
use crate::windowing::{
|
||||||
self, EmbedderCoordinates, MouseWindowEvent, WebRenderDebugOption, WindowMethods,
|
self, EmbedderCoordinates, MouseWindowEvent, WebRenderDebugOption, WindowMethods,
|
||||||
};
|
};
|
||||||
use crate::CompositionPipeline;
|
use crate::{CompositionPipeline, ConstellationMsg, SendableFrameTree};
|
||||||
use crate::SendableFrameTree;
|
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use embedder_traits::Cursor;
|
use embedder_traits::Cursor;
|
||||||
use euclid::{Point2D, Rect, Scale, Vector2D};
|
use euclid::{Point2D, Rect, Scale, Vector2D};
|
||||||
|
@ -28,7 +27,7 @@ use num_traits::FromPrimitive;
|
||||||
use pixels::PixelFormat;
|
use pixels::PixelFormat;
|
||||||
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
|
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
|
||||||
use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent, TouchEvent, WheelEvent};
|
use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent, TouchEvent, WheelEvent};
|
||||||
use script_traits::{AnimationState, AnimationTickType, ConstellationMsg, LayoutControlMsg};
|
use script_traits::{AnimationState, AnimationTickType, LayoutControlMsg};
|
||||||
use script_traits::{
|
use script_traits::{
|
||||||
MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId, WheelDelta,
|
MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId, WheelDelta,
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
//! Communication with the compositor thread.
|
//! Communication with the compositor thread.
|
||||||
|
|
||||||
use crate::compositor::CompositingReason;
|
use crate::compositor::CompositingReason;
|
||||||
use crate::SendableFrameTree;
|
use crate::{ConstellationMsg, SendableFrameTree};
|
||||||
use crossbeam_channel::{Receiver, Sender};
|
use crossbeam_channel::{Receiver, Sender};
|
||||||
use embedder_traits::EventLoopWaker;
|
use embedder_traits::EventLoopWaker;
|
||||||
use euclid::Rect;
|
use euclid::Rect;
|
||||||
|
@ -15,7 +15,7 @@ use msg::constellation_msg::{PipelineId, TopLevelBrowsingContextId};
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
use profile_traits::mem;
|
use profile_traits::mem;
|
||||||
use profile_traits::time;
|
use profile_traits::time;
|
||||||
use script_traits::{AnimationState, ConstellationMsg, EventResult, MouseButton, MouseEventType};
|
use script_traits::{AnimationState, EventResult, MouseButton, MouseEventType};
|
||||||
use std::fmt::{Debug, Error, Formatter};
|
use std::fmt::{Debug, Error, Formatter};
|
||||||
use style_traits::viewport::ViewportConstraints;
|
use style_traits::viewport::ViewportConstraints;
|
||||||
use style_traits::CSSPixel;
|
use style_traits::CSSPixel;
|
||||||
|
|
|
@ -11,10 +11,24 @@ pub use crate::compositor::CompositingReason;
|
||||||
pub use crate::compositor::IOCompositor;
|
pub use crate::compositor::IOCompositor;
|
||||||
pub use crate::compositor::ShutdownState;
|
pub use crate::compositor::ShutdownState;
|
||||||
pub use crate::compositor_thread::CompositorProxy;
|
pub use crate::compositor_thread::CompositorProxy;
|
||||||
|
use embedder_traits::Cursor;
|
||||||
|
use gfx_traits::Epoch;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
|
use keyboard_types::KeyboardEvent;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use msg::constellation_msg::TopLevelBrowsingContextId;
|
use msg::constellation_msg::TopLevelBrowsingContextId;
|
||||||
use script_traits::{ConstellationControlMsg, LayoutControlMsg};
|
use msg::constellation_msg::{BrowsingContextId, TraversalDirection};
|
||||||
|
use script_traits::{
|
||||||
|
AnimationTickType, LogEntry, WebDriverCommandMsg, WindowSizeData, WindowSizeType,
|
||||||
|
};
|
||||||
|
use script_traits::{
|
||||||
|
CompositorEvent, ConstellationControlMsg, LayoutControlMsg, MediaSessionActionType,
|
||||||
|
};
|
||||||
|
use servo_url::ServoUrl;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
use std::fmt;
|
||||||
|
use std::time::Duration;
|
||||||
|
use webvr_traits::WebVREvent;
|
||||||
|
|
||||||
mod compositor;
|
mod compositor;
|
||||||
pub mod compositor_thread;
|
pub mod compositor_thread;
|
||||||
|
@ -36,3 +50,98 @@ pub struct CompositionPipeline {
|
||||||
pub script_chan: IpcSender<ConstellationControlMsg>,
|
pub script_chan: IpcSender<ConstellationControlMsg>,
|
||||||
pub layout_chan: IpcSender<LayoutControlMsg>,
|
pub layout_chan: IpcSender<LayoutControlMsg>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Messages to the constellation.
|
||||||
|
pub enum ConstellationMsg {
|
||||||
|
/// Exit the constellation.
|
||||||
|
Exit,
|
||||||
|
/// Request that the constellation send the BrowsingContextId corresponding to the document
|
||||||
|
/// with the provided pipeline id
|
||||||
|
GetBrowsingContext(PipelineId, IpcSender<Option<BrowsingContextId>>),
|
||||||
|
/// Request that the constellation send the current pipeline id for the provided
|
||||||
|
/// browsing context id, over a provided channel.
|
||||||
|
GetPipeline(BrowsingContextId, IpcSender<Option<PipelineId>>),
|
||||||
|
/// Request that the constellation send the current focused top-level browsing context id,
|
||||||
|
/// over a provided channel.
|
||||||
|
GetFocusTopLevelBrowsingContext(IpcSender<Option<TopLevelBrowsingContextId>>),
|
||||||
|
/// Query the constellation to see if the current compositor output is stable
|
||||||
|
IsReadyToSaveImage(HashMap<PipelineId, Epoch>),
|
||||||
|
/// Inform the constellation of a key event.
|
||||||
|
Keyboard(KeyboardEvent),
|
||||||
|
/// Whether to allow script to navigate.
|
||||||
|
AllowNavigationResponse(PipelineId, bool),
|
||||||
|
/// Request to load a page.
|
||||||
|
LoadUrl(TopLevelBrowsingContextId, ServoUrl),
|
||||||
|
/// Request to traverse the joint session history of the provided browsing context.
|
||||||
|
TraverseHistory(TopLevelBrowsingContextId, TraversalDirection),
|
||||||
|
/// Inform the constellation of a window being resized.
|
||||||
|
WindowSize(
|
||||||
|
Option<TopLevelBrowsingContextId>,
|
||||||
|
WindowSizeData,
|
||||||
|
WindowSizeType,
|
||||||
|
),
|
||||||
|
/// Requests that the constellation instruct layout to begin a new tick of the animation.
|
||||||
|
TickAnimation(PipelineId, AnimationTickType),
|
||||||
|
/// Dispatch a webdriver command
|
||||||
|
WebDriverCommand(WebDriverCommandMsg),
|
||||||
|
/// Reload a top-level browsing context.
|
||||||
|
Reload(TopLevelBrowsingContextId),
|
||||||
|
/// A log entry, with the top-level browsing context id and thread name
|
||||||
|
LogEntry(Option<TopLevelBrowsingContextId>, Option<String>, LogEntry),
|
||||||
|
/// Dispatch WebVR events to the subscribed script threads.
|
||||||
|
WebVREvents(Vec<PipelineId>, Vec<WebVREvent>),
|
||||||
|
/// Create a new top level browsing context.
|
||||||
|
NewBrowser(ServoUrl, TopLevelBrowsingContextId),
|
||||||
|
/// Close a top level browsing context.
|
||||||
|
CloseBrowser(TopLevelBrowsingContextId),
|
||||||
|
/// Panic a top level browsing context.
|
||||||
|
SendError(Option<TopLevelBrowsingContextId>, String),
|
||||||
|
/// Make browser visible.
|
||||||
|
SelectBrowser(TopLevelBrowsingContextId),
|
||||||
|
/// Forward an event to the script task of the given pipeline.
|
||||||
|
ForwardEvent(PipelineId, CompositorEvent),
|
||||||
|
/// Requesting a change to the onscreen cursor.
|
||||||
|
SetCursor(Cursor),
|
||||||
|
/// Enable the sampling profiler, with a given sampling rate and max total sampling duration.
|
||||||
|
EnableProfiler(Duration, Duration),
|
||||||
|
/// Disable the sampling profiler.
|
||||||
|
DisableProfiler,
|
||||||
|
/// Request to exit from fullscreen mode
|
||||||
|
ExitFullScreen(TopLevelBrowsingContextId),
|
||||||
|
/// Media session action.
|
||||||
|
MediaSessionAction(MediaSessionActionType),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for ConstellationMsg {
|
||||||
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
use self::ConstellationMsg::*;
|
||||||
|
let variant = match *self {
|
||||||
|
Exit => "Exit",
|
||||||
|
GetBrowsingContext(..) => "GetBrowsingContext",
|
||||||
|
GetPipeline(..) => "GetPipeline",
|
||||||
|
GetFocusTopLevelBrowsingContext(..) => "GetFocusTopLevelBrowsingContext",
|
||||||
|
IsReadyToSaveImage(..) => "IsReadyToSaveImage",
|
||||||
|
Keyboard(..) => "Keyboard",
|
||||||
|
AllowNavigationResponse(..) => "AllowNavigationResponse",
|
||||||
|
LoadUrl(..) => "LoadUrl",
|
||||||
|
TraverseHistory(..) => "TraverseHistory",
|
||||||
|
WindowSize(..) => "WindowSize",
|
||||||
|
TickAnimation(..) => "TickAnimation",
|
||||||
|
WebDriverCommand(..) => "WebDriverCommand",
|
||||||
|
Reload(..) => "Reload",
|
||||||
|
LogEntry(..) => "LogEntry",
|
||||||
|
WebVREvents(..) => "WebVREvents",
|
||||||
|
NewBrowser(..) => "NewBrowser",
|
||||||
|
CloseBrowser(..) => "CloseBrowser",
|
||||||
|
SendError(..) => "SendError",
|
||||||
|
SelectBrowser(..) => "SelectBrowser",
|
||||||
|
ForwardEvent(..) => "ForwardEvent",
|
||||||
|
SetCursor(..) => "SetCursor",
|
||||||
|
EnableProfiler(..) => "EnableProfiler",
|
||||||
|
DisableProfiler => "DisableProfiler",
|
||||||
|
ExitFullScreen(..) => "ExitFullScreen",
|
||||||
|
MediaSessionAction(..) => "MediaSessionAction",
|
||||||
|
};
|
||||||
|
write!(formatter, "ConstellationMsg::{}", variant)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@ use std::rc::Rc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use style_traits::DevicePixel;
|
use style_traits::DevicePixel;
|
||||||
|
|
||||||
|
use rust_webvr::VRServiceManager;
|
||||||
use webrender_api::units::DevicePoint;
|
use webrender_api::units::DevicePoint;
|
||||||
use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
|
use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
|
||||||
use webrender_api::ScrollLocation;
|
use webrender_api::ScrollLocation;
|
||||||
use webvr::VRServiceManager;
|
|
||||||
use webvr_traits::WebVRMainThreadHeartbeat;
|
use webvr_traits::WebVRMainThreadHeartbeat;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -109,7 +109,7 @@ use canvas_traits::canvas::{CanvasId, CanvasMsg};
|
||||||
use canvas_traits::webgl::WebGLThreads;
|
use canvas_traits::webgl::WebGLThreads;
|
||||||
use compositing::compositor_thread::CompositorProxy;
|
use compositing::compositor_thread::CompositorProxy;
|
||||||
use compositing::compositor_thread::Msg as ToCompositorMsg;
|
use compositing::compositor_thread::Msg as ToCompositorMsg;
|
||||||
use compositing::SendableFrameTree;
|
use compositing::{ConstellationMsg as FromCompositorMsg, SendableFrameTree};
|
||||||
use crossbeam_channel::{after, never, unbounded, Receiver, Sender};
|
use crossbeam_channel::{after, never, unbounded, Receiver, Sender};
|
||||||
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
|
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
|
||||||
use embedder_traits::{Cursor, EmbedderMsg, EmbedderProxy, EventLoopWaker};
|
use embedder_traits::{Cursor, EmbedderMsg, EmbedderProxy, EventLoopWaker};
|
||||||
|
@ -145,9 +145,7 @@ use script_traits::{webdriver_msg, LogEntry, ScriptToConstellationChan, ServiceW
|
||||||
use script_traits::{
|
use script_traits::{
|
||||||
AnimationState, AnimationTickType, AuxiliaryBrowsingContextLoadInfo, CompositorEvent,
|
AnimationState, AnimationTickType, AuxiliaryBrowsingContextLoadInfo, CompositorEvent,
|
||||||
};
|
};
|
||||||
use script_traits::{
|
use script_traits::{ConstellationControlMsg, DiscardBrowsingContext};
|
||||||
ConstellationControlMsg, ConstellationMsg as FromCompositorMsg, DiscardBrowsingContext,
|
|
||||||
};
|
|
||||||
use script_traits::{DocumentActivity, DocumentState, LayoutControlMsg, LoadData, LoadOrigin};
|
use script_traits::{DocumentActivity, DocumentState, LayoutControlMsg, LoadData, LoadOrigin};
|
||||||
use script_traits::{HistoryEntryReplacement, IFrameSizeMsg, WindowSizeData, WindowSizeType};
|
use script_traits::{HistoryEntryReplacement, IFrameSizeMsg, WindowSizeData, WindowSizeType};
|
||||||
use script_traits::{
|
use script_traits::{
|
||||||
|
|
|
@ -419,7 +419,7 @@ pub enum EventPhase {
|
||||||
/// helps us to prevent such events from being [sent to the constellation][msg] where it will be
|
/// helps us to prevent such events from being [sent to the constellation][msg] where it will be
|
||||||
/// handled once again for page scrolling (which is definitely not what we'd want).
|
/// handled once again for page scrolling (which is definitely not what we'd want).
|
||||||
///
|
///
|
||||||
/// [msg]: https://doc.servo.org/script_traits/enum.ConstellationMsg.html#variant.KeyEvent
|
/// [msg]: https://doc.servo.org/compositing/enum.ConstellationMsg.html#variant.KeyEvent
|
||||||
///
|
///
|
||||||
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)]
|
||||||
pub enum EventDefault {
|
pub enum EventDefault {
|
||||||
|
|
|
@ -28,7 +28,7 @@ use bluetooth_traits::BluetoothRequest;
|
||||||
use canvas_traits::webgl::WebGLPipeline;
|
use canvas_traits::webgl::WebGLPipeline;
|
||||||
use crossbeam_channel::{Receiver, RecvTimeoutError, Sender};
|
use crossbeam_channel::{Receiver, RecvTimeoutError, Sender};
|
||||||
use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId};
|
use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId};
|
||||||
use embedder_traits::{Cursor, EventLoopWaker};
|
use embedder_traits::EventLoopWaker;
|
||||||
use euclid::{default::Point2D, Length, Rect, Scale, Size2D, UnknownUnit, Vector2D};
|
use euclid::{default::Point2D, Length, Rect, Scale, Size2D, UnknownUnit, Vector2D};
|
||||||
use gfx_traits::Epoch;
|
use gfx_traits::Epoch;
|
||||||
use http::HeaderMap;
|
use http::HeaderMap;
|
||||||
|
@ -44,7 +44,7 @@ use msg::constellation_msg::BackgroundHangMonitorRegister;
|
||||||
use msg::constellation_msg::{
|
use msg::constellation_msg::{
|
||||||
BlobId, BrowsingContextId, HistoryStateId, MessagePortId, PipelineId,
|
BlobId, BrowsingContextId, HistoryStateId, MessagePortId, PipelineId,
|
||||||
};
|
};
|
||||||
use msg::constellation_msg::{PipelineNamespaceId, TopLevelBrowsingContextId, TraversalDirection};
|
use msg::constellation_msg::{PipelineNamespaceId, TopLevelBrowsingContextId};
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
use net_traits::image_cache::ImageCache;
|
use net_traits::image_cache::ImageCache;
|
||||||
use net_traits::request::Referrer;
|
use net_traits::request::Referrer;
|
||||||
|
@ -62,7 +62,6 @@ use std::collections::{HashMap, VecDeque};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
|
||||||
use style_traits::CSSPixel;
|
use style_traits::CSSPixel;
|
||||||
use style_traits::SpeculativePainter;
|
use style_traits::SpeculativePainter;
|
||||||
use webrender_api::units::{
|
use webrender_api::units::{
|
||||||
|
@ -836,102 +835,6 @@ pub enum WebDriverCommandMsg {
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Messages to the constellation.
|
|
||||||
#[derive(Deserialize, Serialize)]
|
|
||||||
pub enum ConstellationMsg {
|
|
||||||
/// Exit the constellation.
|
|
||||||
Exit,
|
|
||||||
/// Request that the constellation send the BrowsingContextId corresponding to the document
|
|
||||||
/// with the provided pipeline id
|
|
||||||
GetBrowsingContext(PipelineId, IpcSender<Option<BrowsingContextId>>),
|
|
||||||
/// Request that the constellation send the current pipeline id for the provided
|
|
||||||
/// browsing context id, over a provided channel.
|
|
||||||
GetPipeline(BrowsingContextId, IpcSender<Option<PipelineId>>),
|
|
||||||
/// Request that the constellation send the current focused top-level browsing context id,
|
|
||||||
/// over a provided channel.
|
|
||||||
GetFocusTopLevelBrowsingContext(IpcSender<Option<TopLevelBrowsingContextId>>),
|
|
||||||
/// Query the constellation to see if the current compositor output is stable
|
|
||||||
IsReadyToSaveImage(HashMap<PipelineId, Epoch>),
|
|
||||||
/// Inform the constellation of a key event.
|
|
||||||
Keyboard(KeyboardEvent),
|
|
||||||
/// Whether to allow script to navigate.
|
|
||||||
AllowNavigationResponse(PipelineId, bool),
|
|
||||||
/// Request to load a page.
|
|
||||||
LoadUrl(TopLevelBrowsingContextId, ServoUrl),
|
|
||||||
/// Request to traverse the joint session history of the provided browsing context.
|
|
||||||
TraverseHistory(TopLevelBrowsingContextId, TraversalDirection),
|
|
||||||
/// Inform the constellation of a window being resized.
|
|
||||||
WindowSize(
|
|
||||||
Option<TopLevelBrowsingContextId>,
|
|
||||||
WindowSizeData,
|
|
||||||
WindowSizeType,
|
|
||||||
),
|
|
||||||
/// Requests that the constellation instruct layout to begin a new tick of the animation.
|
|
||||||
TickAnimation(PipelineId, AnimationTickType),
|
|
||||||
/// Dispatch a webdriver command
|
|
||||||
WebDriverCommand(WebDriverCommandMsg),
|
|
||||||
/// Reload a top-level browsing context.
|
|
||||||
Reload(TopLevelBrowsingContextId),
|
|
||||||
/// A log entry, with the top-level browsing context id and thread name
|
|
||||||
LogEntry(Option<TopLevelBrowsingContextId>, Option<String>, LogEntry),
|
|
||||||
/// Dispatch WebVR events to the subscribed script threads.
|
|
||||||
WebVREvents(Vec<PipelineId>, Vec<WebVREvent>),
|
|
||||||
/// Create a new top level browsing context.
|
|
||||||
NewBrowser(ServoUrl, TopLevelBrowsingContextId),
|
|
||||||
/// Close a top level browsing context.
|
|
||||||
CloseBrowser(TopLevelBrowsingContextId),
|
|
||||||
/// Panic a top level browsing context.
|
|
||||||
SendError(Option<TopLevelBrowsingContextId>, String),
|
|
||||||
/// Make browser visible.
|
|
||||||
SelectBrowser(TopLevelBrowsingContextId),
|
|
||||||
/// Forward an event to the script task of the given pipeline.
|
|
||||||
ForwardEvent(PipelineId, CompositorEvent),
|
|
||||||
/// Requesting a change to the onscreen cursor.
|
|
||||||
SetCursor(Cursor),
|
|
||||||
/// Enable the sampling profiler, with a given sampling rate and max total sampling duration.
|
|
||||||
EnableProfiler(Duration, Duration),
|
|
||||||
/// Disable the sampling profiler.
|
|
||||||
DisableProfiler,
|
|
||||||
/// Request to exit from fullscreen mode
|
|
||||||
ExitFullScreen(TopLevelBrowsingContextId),
|
|
||||||
/// Media session action.
|
|
||||||
MediaSessionAction(MediaSessionActionType),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Debug for ConstellationMsg {
|
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
use self::ConstellationMsg::*;
|
|
||||||
let variant = match *self {
|
|
||||||
Exit => "Exit",
|
|
||||||
GetBrowsingContext(..) => "GetBrowsingContext",
|
|
||||||
GetPipeline(..) => "GetPipeline",
|
|
||||||
GetFocusTopLevelBrowsingContext(..) => "GetFocusTopLevelBrowsingContext",
|
|
||||||
IsReadyToSaveImage(..) => "IsReadyToSaveImage",
|
|
||||||
Keyboard(..) => "Keyboard",
|
|
||||||
AllowNavigationResponse(..) => "AllowNavigationResponse",
|
|
||||||
LoadUrl(..) => "LoadUrl",
|
|
||||||
TraverseHistory(..) => "TraverseHistory",
|
|
||||||
WindowSize(..) => "WindowSize",
|
|
||||||
TickAnimation(..) => "TickAnimation",
|
|
||||||
WebDriverCommand(..) => "WebDriverCommand",
|
|
||||||
Reload(..) => "Reload",
|
|
||||||
LogEntry(..) => "LogEntry",
|
|
||||||
WebVREvents(..) => "WebVREvents",
|
|
||||||
NewBrowser(..) => "NewBrowser",
|
|
||||||
CloseBrowser(..) => "CloseBrowser",
|
|
||||||
SendError(..) => "SendError",
|
|
||||||
SelectBrowser(..) => "SelectBrowser",
|
|
||||||
ForwardEvent(..) => "ForwardEvent",
|
|
||||||
SetCursor(..) => "SetCursor",
|
|
||||||
EnableProfiler(..) => "EnableProfiler",
|
|
||||||
DisableProfiler => "DisableProfiler",
|
|
||||||
ExitFullScreen(..) => "ExitFullScreen",
|
|
||||||
MediaSessionAction(..) => "MediaSessionAction",
|
|
||||||
};
|
|
||||||
write!(formatter, "ConstellationMsg::{}", variant)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Resources required by workerglobalscopes
|
/// Resources required by workerglobalscopes
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct WorkerGlobalScopeInit {
|
pub struct WorkerGlobalScopeInit {
|
||||||
|
|
|
@ -71,7 +71,7 @@ use compositing::compositor_thread::{
|
||||||
CompositorProxy, CompositorReceiver, InitialCompositorState, Msg,
|
CompositorProxy, CompositorReceiver, InitialCompositorState, Msg,
|
||||||
};
|
};
|
||||||
use compositing::windowing::{EmbedderMethods, WindowEvent, WindowMethods};
|
use compositing::windowing::{EmbedderMethods, WindowEvent, WindowMethods};
|
||||||
use compositing::{CompositingReason, IOCompositor, ShutdownState};
|
use compositing::{CompositingReason, ConstellationMsg, IOCompositor, ShutdownState};
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
not(target_os = "windows"),
|
not(target_os = "windows"),
|
||||||
not(target_os = "ios"),
|
not(target_os = "ios"),
|
||||||
|
@ -106,9 +106,7 @@ use profile::time as profile_time;
|
||||||
use profile_traits::mem;
|
use profile_traits::mem;
|
||||||
use profile_traits::time;
|
use profile_traits::time;
|
||||||
use script::JSEngineSetup;
|
use script::JSEngineSetup;
|
||||||
use script_traits::{
|
use script_traits::{SWManagerSenders, ScriptToConstellationChan, WindowSizeData};
|
||||||
ConstellationMsg, SWManagerSenders, ScriptToConstellationChan, WindowSizeData,
|
|
||||||
};
|
|
||||||
use servo_config::opts;
|
use servo_config::opts;
|
||||||
use servo_config::{pref, prefs};
|
use servo_config::{pref, prefs};
|
||||||
use servo_media::player::context::GlContext;
|
use servo_media::player::context::GlContext;
|
||||||
|
|
|
@ -12,6 +12,7 @@ path = "lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64 = "0.10"
|
base64 = "0.10"
|
||||||
|
compositing = {path = "../compositing"}
|
||||||
cookie = "0.11"
|
cookie = "0.11"
|
||||||
crossbeam-channel = "0.3"
|
crossbeam-channel = "0.3"
|
||||||
euclid = "0.20"
|
euclid = "0.20"
|
||||||
|
|
|
@ -3,10 +3,11 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::Handler;
|
use crate::Handler;
|
||||||
|
use compositing::ConstellationMsg;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use keyboard_types::webdriver::KeyInputState;
|
use keyboard_types::webdriver::KeyInputState;
|
||||||
use script_traits::webdriver_msg::WebDriverScriptCommand;
|
use script_traits::webdriver_msg::WebDriverScriptCommand;
|
||||||
use script_traits::{ConstellationMsg, MouseButton, MouseEventType, WebDriverCommandMsg};
|
use script_traits::{MouseButton, MouseEventType, WebDriverCommandMsg};
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
|
@ -21,6 +21,7 @@ mod capabilities;
|
||||||
use crate::actions::{InputSourceState, PointerInputState};
|
use crate::actions::{InputSourceState, PointerInputState};
|
||||||
use base64;
|
use base64;
|
||||||
use capabilities::ServoCapabilities;
|
use capabilities::ServoCapabilities;
|
||||||
|
use compositing::ConstellationMsg;
|
||||||
use crossbeam_channel::{after, unbounded, Receiver, Sender};
|
use crossbeam_channel::{after, unbounded, Receiver, Sender};
|
||||||
use euclid::{Rect, Size2D};
|
use euclid::{Rect, Size2D};
|
||||||
use hyper::Method;
|
use hyper::Method;
|
||||||
|
@ -34,7 +35,7 @@ use script_traits::webdriver_msg::{LoadStatus, WebDriverCookieError, WebDriverFr
|
||||||
use script_traits::webdriver_msg::{
|
use script_traits::webdriver_msg::{
|
||||||
WebDriverJSError, WebDriverJSResult, WebDriverJSValue, WebDriverScriptCommand,
|
WebDriverJSError, WebDriverJSResult, WebDriverJSValue, WebDriverScriptCommand,
|
||||||
};
|
};
|
||||||
use script_traits::{ConstellationMsg, LoadData, LoadOrigin, WebDriverCommandMsg};
|
use script_traits::{LoadData, LoadOrigin, WebDriverCommandMsg};
|
||||||
use serde::de::{Deserialize, Deserializer, MapAccess, Visitor};
|
use serde::de::{Deserialize, Deserializer, MapAccess, Visitor};
|
||||||
use serde::ser::{Serialize, Serializer};
|
use serde::ser::{Serialize, Serializer};
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
|
@ -16,6 +16,7 @@ oculusvr = ['rust-webvr/oculusvr']
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
canvas_traits = {path = "../canvas_traits"}
|
canvas_traits = {path = "../canvas_traits"}
|
||||||
|
compositing = {path = "../compositing"}
|
||||||
crossbeam-channel = "0.3"
|
crossbeam-channel = "0.3"
|
||||||
euclid = "0.20"
|
euclid = "0.20"
|
||||||
ipc-channel = "0.12"
|
ipc-channel = "0.12"
|
||||||
|
@ -23,7 +24,6 @@ log = "0.4"
|
||||||
msg = {path = "../msg"}
|
msg = {path = "../msg"}
|
||||||
rust-webvr = {version = "0.16", features = ["mock", "openvr", "vrexternal"]}
|
rust-webvr = {version = "0.16", features = ["mock", "openvr", "vrexternal"]}
|
||||||
rust-webvr-api = "0.16"
|
rust-webvr-api = "0.16"
|
||||||
script_traits = {path = "../script_traits"}
|
|
||||||
servo_config = {path = "../config"}
|
servo_config = {path = "../config"}
|
||||||
sparkle = "0.1"
|
sparkle = "0.1"
|
||||||
webvr_traits = {path = "../webvr_traits" }
|
webvr_traits = {path = "../webvr_traits" }
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use canvas_traits::webgl;
|
use canvas_traits::webgl;
|
||||||
|
use compositing::ConstellationMsg;
|
||||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||||
use euclid::default::Size2D;
|
use euclid::default::Size2D;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use rust_webvr::VRServiceManager;
|
use rust_webvr::VRServiceManager;
|
||||||
use script_traits::ConstellationMsg;
|
|
||||||
use servo_config::pref;
|
use servo_config::pref;
|
||||||
use sparkle::gl::Gl;
|
use sparkle::gl::Gl;
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue