diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-11-17 15:34:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-17 15:34:47 -0600 |
commit | 22aebdf5d41a3509cd6515ccf5edcdf33715a76d (patch) | |
tree | 824af410d147404d0a6dc0908cec85cc71df5bfd /components/layout_thread | |
parent | b3ad71353bf264770bf0b3a87b32d86928eb09d4 (diff) | |
parent | 913c874cb55fd0fdc9e8f3a4c34624cd015fac8a (diff) | |
download | servo-22aebdf5d41a3509cd6515ccf5edcdf33715a76d.tar.gz servo-22aebdf5d41a3509cd6515ccf5edcdf33715a76d.zip |
Auto merge of #14246 - emilio:servo-url, r=SimonSapin
Urlmageddon
<!-- Please describe your changes on the following line: -->
Still needs a bunch of code in net to be converted in order to get more
advantage of this for images and stuff, but meanwhile this should help quite a
bit with #13778.
Still wanted to get this in.
r? @SimonSapin
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14246)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout_thread')
-rw-r--r-- | components/layout_thread/Cargo.toml | 3 | ||||
-rw-r--r-- | components/layout_thread/lib.rs | 39 |
2 files changed, 22 insertions, 20 deletions
diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml index 798abe3eb03..7bdb3ee8e32 100644 --- a/components/layout_thread/Cargo.toml +++ b/components/layout_thread/Cargo.toml @@ -24,6 +24,7 @@ lazy_static = "0.2" log = "0.3.5" msg = {path = "../msg"} net_traits = {path = "../net_traits"} +style_traits = {path = "../style_traits"} parking_lot = {version = "0.3.3", features = ["nightly"]} plugins = {path = "../plugins"} profile_traits = {path = "../profile_traits"} @@ -34,8 +35,8 @@ script_traits = {path = "../script_traits"} selectors = "0.14" serde_derive = "0.8" serde_json = "0.8" +servo_url = {path = "../url"} style = {path = "../style"} -url = {version = "1.2", features = ["heap_size"]} util = {path = "../util"} [dependencies.webrender_traits] diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 8aa51683f1a..1d0ba9728cb 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -40,8 +40,9 @@ extern crate script_layout_interface; extern crate script_traits; extern crate selectors; extern crate serde_json; +extern crate servo_url; extern crate style; -extern crate url; +extern crate style_traits; extern crate util; extern crate webrender_traits; @@ -94,6 +95,7 @@ use script_layout_interface::wrapper_traits::LayoutNode; use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; use script_traits::{StackingContextScrollState, UntrustedNodeAddress}; use selectors::Element; +use servo_url::ServoUrl; use std::borrow::ToOwned; use std::collections::HashMap; use std::hash::BuildHasherDefault; @@ -114,7 +116,6 @@ use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, REPOSITI use style::stylesheets::{Origin, Stylesheet, UserAgentStylesheets}; use style::thread_state; use style::timer::Timer; -use url::Url; use util::geometry::max_rect; use util::opts; use util::prefs::PREFS; @@ -127,7 +128,7 @@ pub struct LayoutThread { id: PipelineId, /// The URL of the pipeline that we belong to. - url: Url, + url: ServoUrl, /// Is the current reflow of an iframe, as opposed to a root window? is_iframe: bool, @@ -213,7 +214,7 @@ pub struct LayoutThread { /// The CSS error reporter for all CSS loaded in this layout thread error_reporter: CSSErrorReporter, - webrender_image_cache: Arc<RwLock<HashMap<(Url, UsePlaceholder), + webrender_image_cache: Arc<RwLock<HashMap<(ServoUrl, UsePlaceholder), WebRenderImageInfo, BuildHasherDefault<FnvHasher>>>>, @@ -234,7 +235,7 @@ impl LayoutThreadFactory for LayoutThread { /// Spawns a new layout thread. fn create(id: PipelineId, - url: Url, + url: ServoUrl, is_iframe: bool, chan: (Sender<Msg>, Receiver<Msg>), pipeline_port: IpcReceiver<LayoutControlMsg>, @@ -254,18 +255,18 @@ impl LayoutThreadFactory for LayoutThread { { // Ensures layout thread is destroyed before we send shutdown message let sender = chan.0; let layout = LayoutThread::new(id, - url, - is_iframe, - chan.1, - pipeline_port, - constellation_chan, - script_chan, - image_cache_thread, - font_cache_thread, - time_profiler_chan, - mem_profiler_chan.clone(), - webrender_api_sender, - layout_threads); + url, + is_iframe, + chan.1, + pipeline_port, + constellation_chan, + script_chan, + image_cache_thread, + font_cache_thread, + time_profiler_chan, + mem_profiler_chan.clone(), + webrender_api_sender, + layout_threads); let reporter_name = format!("layout-reporter-{}", id); mem_profiler_chan.run_with_memory_reporting(|| { @@ -365,7 +366,7 @@ fn add_font_face_rules(stylesheet: &Stylesheet, impl LayoutThread { /// Creates a new `LayoutThread` structure. fn new(id: PipelineId, - url: Url, + url: ServoUrl, is_iframe: bool, port: Receiver<Msg>, pipeline_port: IpcReceiver<LayoutControlMsg>, @@ -1526,7 +1527,7 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> { let res = try!(read_resource_file(filename).map_err(|_| filename)); Ok(Stylesheet::from_bytes( &res, - Url::parse(&format!("chrome://resources/{:?}", filename)).unwrap(), + ServoUrl::parse(&format!("chrome://resources/{:?}", filename)).unwrap(), None, None, Origin::UserAgent, |