[package]
name = "style"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
repository = "https://github.com/servo/stylo"
edition = "2021"
description = "The Stylo CSS engine"

build = "build.rs"

# https://github.com/rust-lang/cargo/issues/3544
links = "servo_style_crate"

[lib]
name = "style"
path = "lib.rs"
doctest = false

[features]
gecko = [
    "bindgen",
    "malloc_size_of/gecko",
    "mozbuild",
    "nsstring",
    "regex",
    "serde",
    "style_traits/gecko",
    "toml",
    "selectors/to_shmem",
    "to_shmem/gecko",
]
servo = [
    "arrayvec/use_union",
    "cssparser/serde",
    "encoding_rs",
    "malloc_size_of/servo",
    "web_atoms",
    "serde",
    "servo_arc/servo",
    "stylo_atoms",
    "servo_config",
    "string_cache",
    "style_traits/servo",
    "url",
    "selectors/to_shmem",
    "to_shmem/servo",
]
gecko_debug = []
gecko_refcount_logging = []

[dependencies]
app_units = "0.7.8"
arrayvec = "0.7"
atomic_refcell = "0.1"
bitflags = "2"
byteorder = "1.0"
cssparser = "0.37"
derive_more = { version = "2", features = ["add", "add_assign", "deref", "deref_mut", "from"] }
dom = { path = "../../../dom/base/rust" }
new_debug_unreachable = "1.0"
encoding_rs = {version = "0.8", optional = true}
euclid = "0.22"
rustc-hash = "2.1.1"
icu_segmenter = { version = "2.0", default-features = false, features = ["auto", "compiled_data"] }
indexmap = {version = "2", features = ["std"]}
itertools = "0.14"
itoa = "1.0"
log = "0.4"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../../../xpcom/rust/malloc_size_of_derive" }
web_atoms = { version = "0.1", optional = true }
nsstring = {path = "../../../xpcom/rust/nsstring/", optional = true}
num_cpus = {version = "1.1.0"}
num-integer = "0.1"
num-traits = "0.2"
num-derive = "0.4"
parking_lot = "0.12"
precomputed-hash = "0.1.1"
rayon = "1"
rayon-core = "1"
selectors = { path = "../selectors" }
serde = {version = "1.0", optional = true, features = ["derive"]}
servo_arc = { path = "../servo_arc" }
stylo_atoms = {path = "../atoms", optional = true}
servo_config = {path = "../config", optional = true}
smallbitvec = "2.3.0"
smallvec = "1.0"
static_assertions = "1.1"
static_prefs = { path = "../../../modules/libpref/init/static_prefs" }
string_cache = { version = "0.8", optional = true }
strum = "0.27"
strum_macros = "0.27"
style_derive = {path = "../style_derive"}
style_traits = {path = "../style_traits"}
to_shmem = {path = "../to_shmem"}
to_shmem_derive = {path = "../to_shmem_derive"}
thin-vec = { version = "0.2.1", features = ["gecko-ffi"] }
uluru = "3.0"
void = "1.0.2"
gecko-profiler = { path = "../../../tools/profiler/rust-api" }
url = { version = "2.5", optional = true, features = ["serde"] }

[build-dependencies]
log = { version = "0.4", features = ["std"] }
bindgen = {version = "0.69", optional = true, default-features = false}
regex = {version = "1.0", optional = true, default-features = false, features = ["perf", "std"]}
walkdir = "2.1.4"
toml = {version = "0.5", optional = true, default-features = false}
mozbuild = {version = "0.1", optional = true}
