diff options
-rw-r--r-- | components/script/dom/bindings/js.rs | 2 | ||||
-rw-r--r-- | components/script/dom/node.rs | 13 | ||||
-rw-r--r-- | components/script/dom/window.rs | 3 | ||||
-rw-r--r-- | components/script/layout_interface.rs | 3 | ||||
-rw-r--r-- | components/script/layout_wrapper.rs | 4 | ||||
-rw-r--r-- | components/script_layout_interface/Cargo.toml | 1 | ||||
-rw-r--r-- | components/script_layout_interface/lib.rs | 9 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 1 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 1 |
9 files changed, 19 insertions, 18 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index f8ddb80e44b..12ff0aa8823 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -33,7 +33,7 @@ use dom::node::Node; use heapsize::HeapSizeOf; use js::jsapi::{Heap, JSObject, JSTracer}; use js::jsval::JSVal; -use layout_interface::TrustedNodeAddress; +use script_layout_interface::TrustedNodeAddress; use script_thread::STACK_ROOTS; use std::cell::UnsafeCell; use std::default::Default; diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index cf3257e7137..fdb9deed87b 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -62,7 +62,7 @@ use msg::constellation_msg::PipelineId; use parse::html::parse_html_fragment; use ref_slice::ref_slice; use script_layout_interface::{HTMLCanvasData, OpaqueStyleAndLayoutData}; -use script_layout_interface::{LayoutNodeType, LayoutElementType}; +use script_layout_interface::{LayoutNodeType, LayoutElementType, TrustedNodeAddress}; use script_traits::UntrustedNodeAddress; use selectors::matching::matches; use selectors::parser::Selector; @@ -2409,17 +2409,6 @@ impl NodeMethods for Node { } } - - -/// The address of a node known to be valid. These are sent from script to layout, -/// and are also used in the HTML parser interface. - -#[derive(Clone, PartialEq, Eq, Copy)] -pub struct TrustedNodeAddress(pub *const c_void); - -#[allow(unsafe_code)] -unsafe impl Send for TrustedNodeAddress {} - pub fn document_from_node<T: DerivedFrom<Node> + Reflectable>(derived: &T) -> Root<Document> { derived.upcast().owner_doc() } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 03fbe2b2a2b..f2f3195c875 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -31,7 +31,7 @@ use dom::element::Element; use dom::eventtarget::EventTarget; use dom::location::Location; use dom::navigator::Navigator; -use dom::node::{Node, TrustedNodeAddress, from_untrusted_node_address, window_from_node}; +use dom::node::{Node, from_untrusted_node_address, window_from_node}; use dom::performance::Performance; use dom::screen::Screen; use dom::storage::Storage; @@ -59,6 +59,7 @@ use profile_traits::time::{ProfilerCategory, TimerMetadata, TimerMetadataFrameTy use profile_traits::time::{ProfilerChan, TimerMetadataReflowType, profile}; use reporter::CSSErrorReporter; use rustc_serialize::base64::{FromBase64, STANDARD, ToBase64}; +use script_layout_interface::TrustedNodeAddress; use script_runtime::{ScriptChan, ScriptPort}; use script_thread::SendableMainThreadScriptChan; use script_thread::{MainThreadScriptChan, MainThreadScriptMsg, RunnableWrapper}; diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index a7018507828..cb645ef6439 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -14,7 +14,7 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender}; use msg::constellation_msg::{PanicMsg, PipelineId, WindowSizeData}; use net_traits::image_cache_thread::ImageCacheThread; use profile_traits::mem::ReportsChan; -use script_layout_interface::OpaqueStyleAndLayoutData; +use script_layout_interface::{OpaqueStyleAndLayoutData, TrustedNodeAddress}; use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; use script_traits::{StackingContextScrollState, UntrustedNodeAddress}; use std::sync::Arc; @@ -37,7 +37,6 @@ pub use dom::htmlobjectelement::is_image_data; pub use dom::node::{CAN_BE_FRAGMENTED, HAS_CHANGED, HAS_DIRTY_DESCENDANTS, IS_DIRTY}; pub use dom::node::LayoutNodeHelpers; pub use dom::node::Node; -pub use dom::node::TrustedNodeAddress; pub use dom::text::Text; diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 405e31005af..1ef916ea500 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -36,13 +36,13 @@ use layout_interface::{CharacterDataTypeId, Document, Element, ElementTypeId}; use layout_interface::{HTMLElementTypeId, LayoutCharacterDataHelpers}; use layout_interface::{LayoutDocumentHelpers, LayoutElementHelpers, LayoutJS}; use layout_interface::{LayoutNodeHelpers, Node, NodeTypeId}; -use layout_interface::{RawLayoutElementHelpers, Text, TrustedNodeAddress}; +use layout_interface::{RawLayoutElementHelpers, Text}; use msg::constellation_msg::PipelineId; use range::Range; use script_layout_interface::restyle_damage::RestyleDamage; use script_layout_interface::wrapper_traits::{DangerousThreadSafeLayoutNode, LayoutNode, PseudoElementType}; use script_layout_interface::wrapper_traits::{ThreadSafeLayoutNode, ThreadSafeLayoutElement}; -use script_layout_interface::{HTMLCanvasData, LayoutNodeType}; +use script_layout_interface::{HTMLCanvasData, LayoutNodeType, TrustedNodeAddress}; use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData}; use selectors::matching::{DeclarationBlock, ElementFlags}; use selectors::parser::{AttrSelector, NamespaceConstraint}; diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml index 5765f4a5e90..79d0c10682c 100644 --- a/components/script_layout_interface/Cargo.toml +++ b/components/script_layout_interface/Cargo.toml @@ -15,6 +15,7 @@ gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" heapsize_plugin = "0.1.2" ipc-channel = {git = "https://github.com/servo/ipc-channel"} +libc = "0.2" msg = {path = "../msg"} plugins = {path = "../plugins"} range = {path = "../range"} diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs index 8917aad6a76..d9037311f6a 100644 --- a/components/script_layout_interface/lib.rs +++ b/components/script_layout_interface/lib.rs @@ -22,6 +22,7 @@ extern crate core; extern crate gfx_traits; extern crate heapsize; extern crate ipc_channel; +extern crate libc; extern crate msg; extern crate range; extern crate selectors; @@ -36,6 +37,7 @@ pub mod wrapper_traits; use canvas_traits::CanvasMsg; use core::nonzero::NonZero; use ipc_channel::ipc::IpcSender; +use libc::c_void; use restyle_damage::RestyleDamage; use std::cell::RefCell; use style::servo::PrivateStyleData; @@ -87,3 +89,10 @@ pub struct HTMLCanvasData { pub width: u32, pub height: u32, } + +/// The address of a node known to be valid. These are sent from script to layout. +#[derive(Clone, PartialEq, Eq, Copy)] +pub struct TrustedNodeAddress(pub *const c_void); + +#[allow(unsafe_code)] +unsafe impl Send for TrustedNodeAddress {} diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 908b46a123f..91cf4ddbb2f 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -1937,6 +1937,7 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", + "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "plugins 0.0.1", "range 0.0.1", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 7052457476a..0c34232fb20 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -1795,6 +1795,7 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", + "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "plugins 0.0.1", "range 0.0.1", |