diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 131dfbd9e1d..0d59d06d028 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -22,12 +22,12 @@ use euclid::size::{Size2D, TypedSize2D}; use gaol; use gaol::sandbox::{self, Sandbox, SandboxMethods}; use gfx::font_cache_task::FontCacheTask; +use gfx_traits::PaintMsg as FromPaintMsg; use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender}; use ipc_channel::router::ROUTER; use layout_traits::{LayoutControlChan, LayoutTaskFactory}; use msg::compositor_msg::Epoch; use msg::constellation_msg::AnimationState; -use msg::constellation_msg::PaintMsg as FromPaintMsg; use msg::constellation_msg::WebDriverCommandMsg; use msg::constellation_msg::{DocumentState, FrameId, PipelineId}; use msg::constellation_msg::{IframeLoadInfo, IFrameSandboxState, MozBrowserEvent, NavigationDirection}; diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index c2d38442434..64a6ada7593 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -10,11 +10,11 @@ use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; use gfx::font_cache_task::FontCacheTask; use gfx::paint_task::{ChromeToPaintMsg, LayoutToPaintMsg, PaintTask}; +use gfx_traits::PaintMsg; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use layers::geometry::DevicePixel; use layout_traits::{LayoutControlChan, LayoutTaskFactory}; -use msg::constellation_msg::PaintMsg; use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId}; use msg::constellation_msg::{LoadData, MozBrowserEvent, WindowSizeData}; use msg::constellation_msg::{PipelineNamespaceId}; diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 6924b35f2c8..c972ed7cfbc 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -15,12 +15,11 @@ use euclid::rect::Rect; use euclid::size::Size2D; use font_cache_task::FontCacheTask; use font_context::FontContext; -use gfx_traits::{PaintListener, color}; +use gfx_traits::{color, PaintListener, PaintMsg as ConstellationMsg}; use ipc_channel::ipc::IpcSender; use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet}; use layers::platform::surface::{NativeDisplay, NativeSurface}; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind, LayerProperties, ScrollPolicy}; -use msg::constellation_msg::PaintMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use paint_context::PaintContext; use profile_traits::mem::{self, ReportsChan}; diff --git a/components/gfx_traits/Cargo.toml b/components/gfx_traits/Cargo.toml index 6289f073cc7..ce66910fd75 100644 --- a/components/gfx_traits/Cargo.toml +++ b/components/gfx_traits/Cargo.toml @@ -17,3 +17,7 @@ features = ["plugins"] [dependencies.msg] path = "../msg" + +[dependencies] +serde = "0.6" +serde_macros = "0.6" diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index 2500db1db20..b2a7789089e 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -2,14 +2,24 @@ * 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/. */ +#![feature(custom_derive, plugin)] +#![plugin(serde_macros)] #![crate_name = "gfx_traits"] #![crate_type = "rlib"] extern crate azure; extern crate layers; extern crate msg; +extern crate serde; pub mod color; mod paint_listener; pub use paint_listener::PaintListener; +use msg::constellation_msg::Failure; + +/// Messages from the paint task to the constellation. +#[derive(Deserialize, Serialize)] +pub enum PaintMsg { + Failure(Failure), +} diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index bd03f7769b7..6f1acd219cf 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -241,12 +241,6 @@ pub enum MouseButton { Right, } -/// Messages from the paint task to the constellation. -#[derive(Deserialize, Serialize)] -pub enum PaintMsg { - Failure(Failure), -} - #[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)] pub enum AnimationState { AnimationsPresent, diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 3ef0c9ca5a4..c54d85e8b28 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1703,7 +1703,7 @@ impl Node { let mut content = String::new(); for node in iterator { match node.downcast::() { - Some(text) => content.push_str(&text.upcast::().Data()), + Some(ref text) => content.push_str(&text.upcast::().data()), None => (), } } diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 83368e8df21..08fcc44cf5e 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -658,6 +658,8 @@ dependencies = [ "azure 0.2.1 (git+https://github.com/servo/rust-azure)", "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", + "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 9c3bd919b2d..e10d54059d2 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -618,6 +618,8 @@ dependencies = [ "azure 0.2.1 (git+https://github.com/servo/rust-azure)", "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", + "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 95ee579945e..8207fb8d522 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -608,6 +608,8 @@ dependencies = [ "azure 0.2.1 (git+https://github.com/servo/rust-azure)", "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", + "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]]