diff options
-rw-r--r-- | components/layout/Cargo.toml | 3 | ||||
-rw-r--r-- | components/layout/lib.rs | 33 | ||||
-rw-r--r-- | components/layout_thread/Cargo.toml | 36 | ||||
-rw-r--r-- | components/layout_thread/lib.rs (renamed from components/layout/layout_thread.rs) | 72 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 35 | ||||
-rw-r--r-- | components/servo/Cargo.toml | 1 | ||||
-rw-r--r-- | components/servo/lib.rs | 6 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 35 |
8 files changed, 169 insertions, 52 deletions
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index c6b1727d1d5..9800610d6bb 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -21,7 +21,6 @@ gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" heapsize_plugin = "0.1.2" ipc-channel = {git = "https://github.com/servo/ipc-channel"} -layout_traits = {path = "../layout_traits"} libc = "0.2" log = "0.3.5" msg = {path = "../msg"} @@ -30,11 +29,9 @@ plugins = {path = "../plugins"} profile_traits = {path = "../profile_traits"} range = {path = "../range"} rustc-serialize = "0.3" -script = {path = "../script"} script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} selectors = {version = "0.6", features = ["heap_size"]} -serde_json = "0.7" serde_macros = "0.7" smallvec = "0.1" string_cache = {version = "0.2.20", features = ["heap_size"]} diff --git a/components/layout/lib.rs b/components/layout/lib.rs index d1eb3cf41ba..12769808d50 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -6,7 +6,6 @@ #![feature(box_patterns)] #![feature(box_syntax)] #![feature(custom_derive)] -#![feature(mpsc_select)] #![feature(nonzero)] #![feature(plugin)] #![feature(raw)] @@ -32,7 +31,6 @@ extern crate gfx; extern crate gfx_traits; extern crate heapsize; extern crate ipc_channel; -extern crate layout_traits; extern crate libc; #[macro_use] extern crate log; @@ -46,11 +44,9 @@ extern crate profile_traits; #[macro_use] extern crate range; extern crate rustc_serialize; -extern crate script; extern crate script_layout_interface; extern crate script_traits; extern crate selectors; -extern crate serde_json; extern crate smallvec; #[macro_use(atom, ns)] extern crate string_cache; extern crate style; @@ -63,32 +59,31 @@ extern crate util; extern crate webrender_traits; #[macro_use] -mod layout_debug; +pub mod layout_debug; -mod animation; +pub mod animation; mod block; -mod construct; -mod context; +pub mod construct; +pub mod context; mod data; -mod display_list_builder; +pub mod display_list_builder; mod flex; mod floats; -mod flow; +pub mod flow; mod flow_list; -mod flow_ref; +pub mod flow_ref; mod fragment; mod generated_content; -mod incremental; +pub mod incremental; mod inline; -pub mod layout_thread; mod list_item; mod model; mod multicol; mod opaque_node; -mod parallel; +pub mod parallel; mod persistent_list; -mod query; -mod sequential; +pub mod query; +pub mod sequential; mod table; mod table_caption; mod table_cell; @@ -97,9 +92,9 @@ mod table_row; mod table_rowgroup; mod table_wrapper; mod text; -mod traversal; -mod webrender_helpers; -mod wrapper; +pub mod traversal; +pub mod webrender_helpers; +pub mod wrapper; // For unit tests: pub use fragment::Fragment; diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml new file mode 100644 index 00000000000..050fea38197 --- /dev/null +++ b/components/layout_thread/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "layout_thread" +version = "0.0.1" +authors = ["The Servo Project Developers"] +publish = false + +[lib] +name = "layout_thread" +path = "lib.rs" + +[dependencies] +app_units = {version = "0.2.3", features = ["plugins"]} +azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]} +euclid = {version = "0.6.4", features = ["plugins"]} +fnv = "1.0" +gfx = {path = "../gfx"} +gfx_traits = {path = "../gfx_traits"} +heapsize = "0.3.0" +heapsize_plugin = "0.1.2" +ipc-channel = {git = "https://github.com/servo/ipc-channel"} +layout = {path = "../layout"} +layout_traits = {path = "../layout_traits"} +log = "0.3.5" +msg = {path = "../msg"} +net_traits = {path = "../net_traits"} +plugins = {path = "../plugins"} +profile_traits = {path = "../profile_traits"} +script = {path = "../script"} +script_layout_interface = {path = "../script_layout_interface"} +script_traits = {path = "../script_traits"} +serde_json = "0.7" +serde_macros = "0.7" +style = {path = "../style"} +url = {version = "1.0.0", features = ["heap_size"]} +util = {path = "../util"} +webrender_traits = {git = "https://github.com/servo/webrender_traits"} diff --git a/components/layout/layout_thread.rs b/components/layout_thread/lib.rs index 3f8fabde24b..e3c904d590b 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout_thread/lib.rs @@ -5,21 +5,48 @@ //! The layout thread. Performs layout on the DOM, builds display lists and sends them to be //! painted. -#![allow(unsafe_code)] +#![feature(box_syntax)] +#![feature(custom_derive)] +#![feature(mpsc_select)] +#![feature(plugin)] + +#![plugin(heapsize_plugin)] +#![plugin(plugins)] + +extern crate app_units; +extern crate azure; +extern crate core; +extern crate euclid; +extern crate fnv; +extern crate gfx; +extern crate gfx_traits; +extern crate heapsize; +extern crate ipc_channel; +#[macro_use] +extern crate layout; +extern crate layout_traits; +#[macro_use] +extern crate log; +extern crate msg; +extern crate net_traits; +#[macro_use] +extern crate profile_traits; +extern crate script; +extern crate script_layout_interface; +extern crate script_traits; +extern crate serde_json; +extern crate style; +extern crate url; +extern crate util; +extern crate webrender_traits; -use animation; use app_units::Au; use azure::azure::AzColor; -use construct::ConstructionResult; -use context::{LayoutContext, SharedLayoutContext, heap_size_of_local_context}; -use display_list_builder::ToGfxColor; use euclid::Matrix4D; use euclid::point::Point2D; use euclid::rect::Rect; use euclid::scale_factor::ScaleFactor; use euclid::size::Size2D; -use flow::{self, Flow, ImmutableFlowUtils, MutableOwnedFlowUtils}; -use flow_ref::{self, FlowRef}; use fnv::FnvHasher; use gfx::display_list::{ClippingRegion, DisplayList, LayerInfo, OpaqueNode}; use gfx::display_list::{StackingContext, StackingContextType, WebRenderImageInfo}; @@ -29,23 +56,32 @@ use gfx::font_context; use gfx::paint_thread::LayoutToPaintMsg; use gfx_traits::{color, Epoch, FragmentType, LayerId, ScrollPolicy, StackingContextId}; use heapsize::HeapSizeOf; -use incremental::{LayoutDamageComputation, REFLOW_ENTIRE_DOCUMENT}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; -use layout_debug; +use layout::animation; +use layout::construct::ConstructionResult; +use layout::context::{LayoutContext, SharedLayoutContext, heap_size_of_local_context}; +use layout::display_list_builder::ToGfxColor; +use layout::flow::{self, Flow, ImmutableFlowUtils, MutableOwnedFlowUtils}; +use layout::flow_ref::{self, FlowRef}; +use layout::incremental::{LayoutDamageComputation, REFLOW_ENTIRE_DOCUMENT}; +use layout::layout_debug; +use layout::parallel; +use layout::query::process_offset_parent_query; +use layout::query::{LayoutRPCImpl, LayoutThreadData, process_content_box_request, process_content_boxes_request}; +use layout::query::{process_node_geometry_request, process_node_layer_id_request, process_node_scroll_area_request}; +use layout::query::{process_node_overflow_request, process_resolved_style_request, process_margin_style_query}; +use layout::sequential; +use layout::traversal::RecalcStyleAndConstructFlows; +use layout::webrender_helpers::{WebRenderDisplayListConverter, WebRenderFrameBuilder}; +use layout::wrapper::{LayoutNodeLayoutData, NonOpaqueStyleAndLayoutData}; use layout_traits::LayoutThreadFactory; -use log; use msg::constellation_msg::{PanicMsg, PipelineId}; use net_traits::image_cache_thread::UsePlaceholder; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread}; -use parallel; use profile_traits::mem::{self, Report, ReportKind, ReportsChan}; use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType}; use profile_traits::time::{self, TimerMetadata, profile}; -use query::process_offset_parent_query; -use query::{LayoutRPCImpl, LayoutThreadData, process_content_box_request, process_content_boxes_request}; -use query::{process_node_geometry_request, process_node_layer_id_request, process_node_scroll_area_request}; -use query::{process_node_overflow_request, process_resolved_style_request, process_margin_style_query}; use script::layout_wrapper::ServoLayoutNode; use script_layout_interface::message::{Msg, NewLayoutThreadInfo, Reflow, ReflowQueryType, ScriptReflow}; use script_layout_interface::reporter::CSSErrorReporter; @@ -55,8 +91,6 @@ use script_layout_interface::wrapper_traits::LayoutNode; use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData}; use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; use script_traits::{StackingContextScrollState, UntrustedNodeAddress}; -use sequential; -use serde_json; use std::borrow::ToOwned; use std::cell::RefCell; use std::collections::HashMap; @@ -77,7 +111,6 @@ use style::properties::ComputedValues; use style::selector_matching::USER_OR_USER_AGENT_STYLESHEETS; use style::servo::{SharedStyleContext, Stylesheet, Stylist}; use style::stylesheets::CSSRuleIteratorExt; -use traversal::RecalcStyleAndConstructFlows; use url::Url; use util::geometry::MAX_RECT; use util::ipc::OptionalIpcSender; @@ -85,9 +118,6 @@ use util::opts; use util::thread; use util::thread_state; use util::workqueue::WorkQueue; -use webrender_helpers::{WebRenderDisplayListConverter, WebRenderFrameBuilder}; -use webrender_traits; -use wrapper::{LayoutNodeLayoutData, NonOpaqueStyleAndLayoutData}; /// The number of screens we have to traverse before we decide to generate new display lists. const DISPLAY_PORT_THRESHOLD_SIZE_FACTOR: i32 = 4; diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 0b3c9855b79..01496d06718 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -21,6 +21,7 @@ dependencies = [ "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "layout 0.0.1", "layout_tests 0.0.1", + "layout_thread 0.0.1", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1148,7 +1149,6 @@ 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)", - "layout_traits 0.0.1", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1157,11 +1157,9 @@ dependencies = [ "profile_traits 0.0.1", "range 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "script 0.0.1", "script_layout_interface 0.0.1", "script_traits 0.0.1", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1183,6 +1181,37 @@ dependencies = [ ] [[package]] +name = "layout_thread" +version = "0.0.1" +dependencies = [ + "app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "azure 0.4.5 (git+https://github.com/servo/rust-azure)", + "euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx 0.0.1", + "gfx_traits 0.0.1", + "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)", + "layout 0.0.1", + "layout_traits 0.0.1", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "msg 0.0.1", + "net_traits 0.0.1", + "plugins 0.0.1", + "profile_traits 0.0.1", + "script 0.0.1", + "script_layout_interface 0.0.1", + "script_traits 0.0.1", + "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "style 0.0.1", + "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "util 0.0.1", + "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", +] + +[[package]] name = "layout_traits" version = "0.0.1" dependencies = [ diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index dc1dc080e73..fee429f6ff1 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -57,6 +57,7 @@ util = {path = "../util"} script = {path = "../script"} script_traits = {path = "../script_traits"} layout = {path = "../layout"} +layout_thread = {path = "../layout_thread"} gfx = {path = "../gfx"} style = {path = "../style"} canvas = {path = "../canvas"} diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 5f98a1894b6..3f00d6ec427 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -31,7 +31,7 @@ pub extern crate devtools_traits; pub extern crate euclid; pub extern crate gfx; pub extern crate ipc_channel; -pub extern crate layout; +pub extern crate layout_thread; pub extern crate msg; pub extern crate net; pub extern crate net_traits; @@ -231,7 +231,7 @@ fn create_constellation(opts: opts::Opts, }; let constellation_chan = Constellation::<script_layout_interface::message::Msg, - layout::layout_thread::LayoutThread, + layout_thread::LayoutThread, script::script_thread::ScriptThread>::start(initial_state); // Send the URL command to the constellation. @@ -265,7 +265,7 @@ pub fn run_content_process(token: String) { script::init(); unprivileged_content.start_all::<script_layout_interface::message::Msg, - layout::layout_thread::LayoutThread, + layout_thread::LayoutThread, script::script_thread::ScriptThread>(true); } diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index a5fc590683d..2460ac77395 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -1060,7 +1060,6 @@ 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)", - "layout_traits 0.0.1", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1069,11 +1068,9 @@ dependencies = [ "profile_traits 0.0.1", "range 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "script 0.0.1", "script_layout_interface 0.0.1", "script_traits 0.0.1", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1088,6 +1085,37 @@ dependencies = [ ] [[package]] +name = "layout_thread" +version = "0.0.1" +dependencies = [ + "app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "azure 0.4.5 (git+https://github.com/servo/rust-azure)", + "euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx 0.0.1", + "gfx_traits 0.0.1", + "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)", + "layout 0.0.1", + "layout_traits 0.0.1", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "msg 0.0.1", + "net_traits 0.0.1", + "plugins 0.0.1", + "profile_traits 0.0.1", + "script 0.0.1", + "script_layout_interface 0.0.1", + "script_traits 0.0.1", + "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "style 0.0.1", + "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "util 0.0.1", + "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", +] + +[[package]] name = "layout_traits" version = "0.0.1" dependencies = [ @@ -1913,6 +1941,7 @@ dependencies = [ "glutin_app 0.0.1", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "layout 0.0.1", + "layout_thread 0.0.1", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", |