Move stylearc into a separate crate.

MozReview-Commit-ID: C3btN8Jw9sJ
This commit is contained in:
Bobby Holley 2017-06-02 17:40:00 -07:00
parent 992059c856
commit fa9d2cb036
5 changed files with 35 additions and 3 deletions

9
Cargo.lock generated
View file

@ -2688,6 +2688,14 @@ dependencies = [
"url 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "servo_arc"
version = "0.0.1"
dependencies = [
"heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "servo_atoms" name = "servo_atoms"
version = "0.0.1" version = "0.0.1"
@ -2913,6 +2921,7 @@ dependencies = [
"selectors 0.19.0", "selectors 0.19.0",
"serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_arc 0.0.1",
"servo_atoms 0.0.1", "servo_atoms 0.0.1",
"servo_config 0.0.1", "servo_config 0.0.1",
"servo_url 0.0.1", "servo_url 0.0.1",

View file

@ -0,0 +1,17 @@
[package]
name = "servo_arc"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
publish = false
[lib]
name = "servo_arc"
path = "lib.rs"
[features]
servo = ["serde", "heapsize"]
[dependencies]
heapsize = {version = "0.4.0", optional = true}
serde = {version = "0.9", optional = true}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
//! Fork of Arc for the style system. This has the following advantages over std::Arc: //! Fork of Arc for Servo. This has the following advantages over std::Arc:
//! * We don't waste storage on the weak reference count. //! * We don't waste storage on the weak reference count.
//! * We don't do extra RMU operations to handle the possibility of weak references. //! * We don't do extra RMU operations to handle the possibility of weak references.
//! * We can experiment with arena allocation (todo). //! * We can experiment with arena allocation (todo).
@ -20,6 +20,8 @@
// duplicate those here. // duplicate those here.
#![allow(missing_docs)] #![allow(missing_docs)]
#[cfg(feature = "servo")] extern crate serde;
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
use heapsize::HeapSizeOf; use heapsize::HeapSizeOf;
#[cfg(feature = "servo")] #[cfg(feature = "servo")]

View file

@ -61,6 +61,7 @@ rayon = "0.7.1"
selectors = { path = "../selectors" } selectors = { path = "../selectors" }
serde = {version = "0.9", optional = true} serde = {version = "0.9", optional = true}
serde_derive = {version = "0.9", optional = true} serde_derive = {version = "0.9", optional = true}
servo_arc = { path = "../servo_arc" }
servo_atoms = {path = "../atoms", optional = true} servo_atoms = {path = "../atoms", optional = true}
servo_config = {path = "../config", optional = true} servo_config = {path = "../config", optional = true}
smallvec = "0.4" smallvec = "0.4"

View file

@ -72,8 +72,8 @@ extern crate pdqsort;
#[cfg(feature = "gecko")] extern crate precomputed_hash; #[cfg(feature = "gecko")] extern crate precomputed_hash;
extern crate rayon; extern crate rayon;
extern crate selectors; extern crate selectors;
#[cfg(feature = "servo")] extern crate serde;
#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive; #[cfg(feature = "servo")] #[macro_use] extern crate serde_derive;
pub extern crate servo_arc;
#[cfg(feature = "servo")] #[macro_use] extern crate servo_atoms; #[cfg(feature = "servo")] #[macro_use] extern crate servo_atoms;
#[cfg(feature = "servo")] extern crate servo_config; #[cfg(feature = "servo")] extern crate servo_config;
#[cfg(feature = "servo")] extern crate servo_url; #[cfg(feature = "servo")] extern crate servo_url;
@ -129,7 +129,6 @@ pub mod sequential;
pub mod sink; pub mod sink;
pub mod str; pub mod str;
pub mod style_adjuster; pub mod style_adjuster;
pub mod stylearc;
pub mod stylesheet_set; pub mod stylesheet_set;
pub mod stylesheets; pub mod stylesheets;
pub mod thread_state; pub mod thread_state;
@ -139,6 +138,10 @@ pub mod traversal;
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub mod values; pub mod values;
// Compat shim for the old name when it lived in the style crate.
// FIXME(bholley) Remove this.
pub use servo_arc as stylearc;
use std::fmt; use std::fmt;
use style_traits::ToCss; use style_traits::ToCss;