From 805b20a4faa8a3aa9d9271ae97a5b23bc35a1ad0 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Tue, 19 Mar 2024 23:10:39 +0000 Subject: [PATCH] Bug 1886218 - Unify servo-2013 and servo-2020. r=emilio This imports https://github.com/servo/stylo/commit/c9ca340 from Servo, with minor adjustments for D187431, 'baseline-source', and to ensure that Firefox still compiles. Differential Revision: https://phabricator.services.mozilla.com/D205110 --- servo/components/style/Cargo.toml | 2 - servo/components/style/build.rs | 12 ++-- servo/components/style/properties/build.py | 14 ++-- servo/components/style/properties/data.py | 71 ++++++------------- .../style/properties/helpers.mako.rs | 6 +- .../properties/longhands/background.mako.rs | 18 ++--- .../style/properties/longhands/border.mako.rs | 20 +++--- .../style/properties/longhands/box.mako.rs | 46 ++++++------ .../style/properties/longhands/column.mako.rs | 13 ++-- .../properties/longhands/counters.mako.rs | 8 ++- .../properties/longhands/effects.mako.rs | 12 ++-- .../style/properties/longhands/font.mako.rs | 14 ++-- .../longhands/inherited_box.mako.rs | 13 ++-- .../longhands/inherited_table.mako.rs | 12 ++-- .../longhands/inherited_text.mako.rs | 32 ++++----- .../properties/longhands/inherited_ui.mako.rs | 4 +- .../style/properties/longhands/list.mako.rs | 17 ++--- .../style/properties/longhands/margin.mako.rs | 2 +- .../properties/longhands/outline.mako.rs | 10 ++- .../properties/longhands/padding.mako.rs | 2 +- .../properties/longhands/position.mako.rs | 65 +++++++++-------- .../style/properties/longhands/table.mako.rs | 3 +- .../style/properties/longhands/text.mako.rs | 12 ++-- .../style/properties/longhands/ui.mako.rs | 30 ++++---- .../style/properties/properties.mako.rs | 9 ++- .../properties/shorthands/background.mako.rs | 4 +- .../properties/shorthands/border.mako.rs | 19 ++--- .../style/properties/shorthands/box.mako.rs | 2 +- .../properties/shorthands/column.mako.rs | 4 +- .../style/properties/shorthands/font.mako.rs | 5 +- .../style/properties/shorthands/list.mako.rs | 21 +++++- .../properties/shorthands/margin.mako.rs | 6 +- .../properties/shorthands/outline.mako.rs | 2 +- .../properties/shorthands/padding.mako.rs | 6 +- .../properties/shorthands/position.mako.rs | 14 ++-- .../style/properties/shorthands/text.mako.rs | 2 +- .../style/properties/shorthands/ui.mako.rs | 4 +- servo/components/style/style_adjuster.rs | 8 +-- servo/components/style/traversal.rs | 4 +- .../style/values/generics/counters.rs | 14 +--- .../components/style/values/generics/image.rs | 4 +- .../components/style/values/specified/box.rs | 44 +----------- .../style/values/specified/counters.rs | 11 +-- .../style/values/specified/image.rs | 2 +- .../components/style/values/specified/text.rs | 7 +- 45 files changed, 280 insertions(+), 350 deletions(-) diff --git a/servo/components/style/Cargo.toml b/servo/components/style/Cargo.toml index acf1bcf6fee9..d6e37d49030a 100644 --- a/servo/components/style/Cargo.toml +++ b/servo/components/style/Cargo.toml @@ -21,8 +21,6 @@ gecko = ["nsstring", "serde", "style_traits/gecko", "bindgen", "regex", "toml", 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", "to_shmem/servo", "servo_arc/servo"] -servo-layout-2013 = [] -servo-layout-2020 = [] gecko_debug = [] gecko_refcount_logging = [] diff --git a/servo/components/style/build.rs b/servo/components/style/build.rs index 2247e876181d..4b27edbe2c32 100644 --- a/servo/components/style/build.rs +++ b/servo/components/style/build.rs @@ -71,16 +71,12 @@ fn generate_properties(engine: &str) { fn main() { let gecko = cfg!(feature = "gecko"); let servo = cfg!(feature = "servo"); - let l2013 = cfg!(feature = "servo-layout-2013"); - let l2020 = cfg!(feature = "servo-layout-2020"); - let engine = match (gecko, servo, l2013, l2020) { - (true, false, false, false) => "gecko", - (false, true, true, false) => "servo-2013", - (false, true, false, true) => "servo-2020", + let engine = match (gecko, servo) { + (true, false) => "gecko", + (false, true) => "servo", _ => panic!( "\n\n\ - The style crate requires enabling one of its 'servo' or 'gecko' feature flags \ - and, in the 'servo' case, one of 'servo-layout-2013' or 'servo-layout-2020'.\ + The style crate requires enabling one of its 'servo' or 'gecko' feature flags. \ \n\n" ), }; diff --git a/servo/components/style/properties/build.py b/servo/components/style/properties/build.py index 42121a4eae46..f5307927a352 100644 --- a/servo/components/style/properties/build.py +++ b/servo/components/style/properties/build.py @@ -49,7 +49,7 @@ STYLE_STRUCT_LIST = [ def main(): usage = ( - "Usage: %s [ servo-2013 | servo-2020 | gecko ] [ style-crate | geckolib