diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 1f6027eab24..9fd616bd679 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -49,7 +49,7 @@ serde_json = "1.0" servo_config = {path = "../config"} servo_url = {path = "../url"} smallvec = { version = "0.6", features = ["std", "union"] } -style = {path = "../style", features = ["servo"]} +style = {path = "../style", features = ["servo", "servo-layout-2013"]} style_traits = {path = "../style_traits"} unicode-bidi = {version = "0.3", features = ["with_serde"]} unicode-script = {version = "0.3", features = ["harfbuzz"]} diff --git a/components/script/build.rs b/components/script/build.rs index 1af9fbf7648..d044b6e4fb4 100644 --- a/components/script/build.rs +++ b/components/script/build.rs @@ -42,9 +42,7 @@ fn main() { start.elapsed().as_secs() ); - let json = out_dir - .join("build") - .join("InterfaceObjectMapData.json"); + let json = out_dir.join("build").join("InterfaceObjectMapData.json"); let json: Value = serde_json::from_reader(File::open(&json).unwrap()).unwrap(); let mut map = phf_codegen::Map::new(); for (key, value) in json.as_object().unwrap() { diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index acce17d243b..9c39a957796 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -20,7 +20,8 @@ gecko = ["style_traits/gecko", "fallible/known_system_malloc", "bindgen", "regex servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever", "cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union", "servo_url", "string_cache", "crossbeam-channel", "to_shmem/servo", "servo_arc/servo"] -"servo-layout-2020" = [] +servo-layout-2013 = [] +servo-layout-2020 = [] gecko_debug = [] gecko_refcount_logging = [] gecko_profiler = [] diff --git a/components/style/build.rs b/components/style/build.rs index 0ff8434fa1d..20b3bf5c79f 100644 --- a/components/style/build.rs +++ b/components/style/build.rs @@ -89,14 +89,19 @@ fn generate_properties() { let script = Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap()) .join("properties") .join("build.py"); - let product = if cfg!(feature = "gecko") { - "gecko" - } else { - "servo" - }; + + #[cfg(feature = "gecko")] + let engine = "gecko"; + + #[cfg(feature = "servo-layout-2013")] + let engine = "servo-2013"; + + #[cfg(feature = "servo-layout-2020")] + let engine = "servo-2020"; + let status = Command::new(&*PYTHON) .arg(&script) - .arg(product) + .arg(engine) .arg("style-crate") .status() .unwrap(); @@ -117,6 +122,9 @@ fn main() { feature flags at the same time." ); } + if gecko && (cfg!(feature = "servo-layout-2013") || cfg!(feature = "servo-layout-2020")) { + panic!("The 'servo-layout-*' features can only be enabled together with 'servo'."); + } println!("cargo:rerun-if-changed=build.rs"); println!("cargo:out_dir={}", env::var("OUT_DIR").unwrap()); generate_properties(); diff --git a/components/style/properties/build.py b/components/style/properties/build.py index 6ee5220857c..186018e99a4 100644 --- a/components/style/properties/build.py +++ b/components/style/properties/build.py @@ -30,35 +30,36 @@ STYLE_STRUCT_LIST = [ "effects", "font", "inherited_box", + "inherited_svg", "inherited_table", "inherited_text", "inherited_ui", - "inherited_svg", "list", "margin", "outline", "padding", "position", + "svg", "table", "text", "ui", - "svg", "xul", ] def main(): - usage = ("Usage: %s [ servo | gecko ] [ style-crate | geckolib