From ae74a5d318bc53b31079d5d796551647e7d3e47e Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Thu, 10 Oct 2024 14:53:03 +0100 Subject: [PATCH 01/22] Set malloc_size_of to edition 2021 (no code changes required) --- malloc_size_of/Cargo.toml | 1 + malloc_size_of/lib.rs | 33 --------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index 43c33207e9..bf0245ce6f 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.1" authors = ["The Servo Project Developers"] license = "MIT OR Apache-2.0" repository = "https://github.com/servo/stylo" +edition = "2021" publish = false [lib] diff --git a/malloc_size_of/lib.rs b/malloc_size_of/lib.rs index 0f13447133..019d01d7a2 100644 --- a/malloc_size_of/lib.rs +++ b/malloc_size_of/lib.rs @@ -46,39 +46,6 @@ //! Note: WebRender has a reduced fork of this crate, so that we can avoid //! publishing this crate on crates.io. -#[cfg(feature = "servo")] -extern crate accountable_refcell; -extern crate app_units; -#[cfg(feature = "servo")] -extern crate content_security_policy; -#[cfg(feature = "servo")] -extern crate crossbeam_channel; -extern crate cssparser; -extern crate euclid; -#[cfg(feature = "servo")] -extern crate http; -#[cfg(feature = "servo")] -extern crate keyboard_types; -extern crate selectors; -#[cfg(feature = "servo")] -extern crate serde; -#[cfg(feature = "servo")] -extern crate serde_bytes; -extern crate servo_arc; -extern crate smallbitvec; -extern crate smallvec; -#[cfg(feature = "servo")] -extern crate string_cache; -#[cfg(feature = "url")] -extern crate url; -#[cfg(feature = "servo")] -extern crate uuid; -extern crate void; -#[cfg(feature = "webrender_api")] -extern crate webrender_api; -#[cfg(feature = "servo")] -extern crate xml5ever; - #[cfg(feature = "servo")] use content_security_policy as csp; #[cfg(feature = "servo")] From c368e3c89e1992836ffe91d3efea58a6d4e05bd0 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 14:18:43 +0100 Subject: [PATCH 02/22] Update metadata for stylo_dom crate --- dom/Cargo.toml | 9 ++++++--- malloc_size_of/Cargo.toml | 2 +- style/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dom/Cargo.toml b/dom/Cargo.toml index c0653f0b8f..e73e0b4808 100644 --- a/dom/Cargo.toml +++ b/dom/Cargo.toml @@ -1,10 +1,13 @@ [package] -name = "dom" -version = "0.0.1" +name = "stylo_dom" +version = "0.1.0" authors = ["The Servo Project Developers"] +documentation = "https://docs.rs/stylo_dom/" +description = "Support crate for Stylo CSS engine" +repository = "https://github.com/servo/stylo" +keywords = ["css", "style"] license = "MPL-2.0" edition = "2021" -publish = false [lib] path = "lib.rs" diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index bf0245ce6f..f0b681831c 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -34,7 +34,7 @@ app_units = "0.7" content-security-policy = { version = "0.5", features = ["serde"], optional = true } crossbeam-channel = { version = "0.5", optional = true } cssparser = "0.34" -dom = { path = "../dom" } +dom = { path = "../dom", package = "stylo_dom" } euclid = "0.22" http = { version = "0.2", optional = true } indexmap = { version = "2.2", optional = true } diff --git a/style/Cargo.toml b/style/Cargo.toml index b300c9e93a..19cd54e85c 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -58,7 +58,7 @@ bitflags = "2" byteorder = "1.0" cssparser = "0.34" derive_more = { version = "0.99", default-features = false, features = ["add", "add_assign", "deref", "deref_mut", "from"] } -dom = { path = "../dom" } +dom = { path = "../dom", package = "stylo_dom" } new_debug_unreachable = "1.0" encoding_rs = {version = "0.8", optional = true} euclid = "0.22" From 690b6d7bfdc8262ba2338d30c85bdb177c5740d9 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 14:29:52 +0100 Subject: [PATCH 03/22] Update metadata for stylo_arc crate --- malloc_size_of/Cargo.toml | 2 +- selectors/Cargo.toml | 2 +- servo_arc/Cargo.toml | 5 +++-- style/Cargo.toml | 2 +- style_traits/Cargo.toml | 2 +- to_shmem/Cargo.toml | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index f0b681831c..3ae29a956e 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -42,7 +42,7 @@ keyboard-types = { version = "0.7", optional = true } selectors = { path = "../selectors" } serde = { version = "1.0.195", optional = true } serde_bytes = { version = "0.11", optional = true } -servo_arc = { path = "../servo_arc" } +servo_arc = { path = "../servo_arc", package = "stylo_arc" } smallbitvec = "2.3.0" smallvec = "1.13" string_cache = { version = "0.8", optional = true } diff --git a/selectors/Cargo.toml b/selectors/Cargo.toml index 9c0fa37d21..8990fa6dba 100644 --- a/selectors/Cargo.toml +++ b/selectors/Cargo.toml @@ -27,7 +27,7 @@ fxhash = "0.2" log = "0.4" phf = "0.11" precomputed-hash = "0.1" -servo_arc = { version = "0.4", path = "../servo_arc" } +servo_arc = { version = "0.4", path = "../servo_arc", package = "stylo_arc" } smallvec = "1.0" to_shmem = { version = "0.1", path = "../to_shmem", features = ["servo_arc"], optional = true } to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", optional = true } diff --git a/servo_arc/Cargo.toml b/servo_arc/Cargo.toml index 8b0976b75d..6e0dc13b0d 100644 --- a/servo_arc/Cargo.toml +++ b/servo_arc/Cargo.toml @@ -1,14 +1,15 @@ [package] -name = "servo_arc" +name = "stylo_arc" version = "0.4.0" authors = ["The Servo Project Developers"] license = "MIT OR Apache-2.0" repository = "https://github.com/servo/stylo" +documentation = "https://docs.rs/stylo_arc/" description = "A fork of std::sync::Arc with some extra functionality and without weak references" edition = "2021" [lib] -name = "servo_arc" +name = "stylo_arc" path = "lib.rs" [features] diff --git a/style/Cargo.toml b/style/Cargo.toml index 19cd54e85c..c1758a3c96 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -84,7 +84,7 @@ rayon = "1" rayon-core = "1" selectors = { path = "../selectors" } serde = {version = "1.0", optional = true, features = ["derive"]} -servo_arc = { path = "../servo_arc" } +servo_arc = { path = "../servo_arc", package = "stylo_arc" } servo_atoms = {path = "../atoms", optional = true} smallbitvec = "2.3.0" smallvec = "1.0" diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index c56a771b20..fbdce0d82d 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -24,7 +24,7 @@ malloc_size_of = { path = "../malloc_size_of" } malloc_size_of_derive = "0.1" selectors = { path = "../selectors" } serde = "1.0" -servo_arc = { path = "../servo_arc" } +servo_arc = { path = "../servo_arc", package = "stylo_arc" } servo_atoms = { path = "../atoms", optional = true } thin-vec = "0.2" to_shmem = { path = "../to_shmem" } diff --git a/to_shmem/Cargo.toml b/to_shmem/Cargo.toml index e83bb99430..d2836df357 100644 --- a/to_shmem/Cargo.toml +++ b/to_shmem/Cargo.toml @@ -23,7 +23,7 @@ thin-vec = ["dep:thin-vec"] [dependencies] cssparser = { version = "0.34", optional = true } -servo_arc = { version = "0.4.0", path = "../servo_arc", optional = true } +servo_arc = { version = "0.4.0", path = "../servo_arc", package = "stylo_arc", optional = true } smallbitvec = { version = "2.3.0", optional = true } smallvec = { version = "1.13", optional = true } string_cache = { version = "0.8", optional = true } From 918201d2d8931c7222aad8995e7a2648130a4d84 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 14:35:02 +0100 Subject: [PATCH 04/22] Update metadata for stylo_to_shmem and stylo_to_shmem_derive --- selectors/Cargo.toml | 4 ++-- style/Cargo.toml | 4 ++-- style_traits/Cargo.toml | 4 ++-- to_shmem/Cargo.toml | 4 +++- to_shmem_derive/Cargo.toml | 4 +++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/selectors/Cargo.toml b/selectors/Cargo.toml index 8990fa6dba..2bcc577acd 100644 --- a/selectors/Cargo.toml +++ b/selectors/Cargo.toml @@ -29,8 +29,8 @@ phf = "0.11" precomputed-hash = "0.1" servo_arc = { version = "0.4", path = "../servo_arc", package = "stylo_arc" } smallvec = "1.0" -to_shmem = { version = "0.1", path = "../to_shmem", features = ["servo_arc"], optional = true } -to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", optional = true } +to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem", features = ["servo_arc"], optional = true } +to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", package = "stylo_to_shmem_derive", optional = true } new_debug_unreachable = "1" [build-dependencies] diff --git a/style/Cargo.toml b/style/Cargo.toml index c1758a3c96..22d56bfc50 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -94,8 +94,8 @@ string_cache = { version = "0.8", optional = true } style_config = { path = "../style_config", optional = true } style_derive = {path = "../style_derive"} style_traits = {path = "../style_traits"} -to_shmem = {path = "../to_shmem"} -to_shmem_derive = {path = "../to_shmem_derive"} +to_shmem = {path = "../to_shmem", package = "stylo_to_shmem"} +to_shmem_derive = {path = "../to_shmem_derive", package = "stylo_to_shmem_derive"} thin-vec = "0.2.1" uluru = "3.0" unicode-bidi = { version = "0.3", default-features = false } diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index fbdce0d82d..75a33dbbe5 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -27,7 +27,7 @@ serde = "1.0" servo_arc = { path = "../servo_arc", package = "stylo_arc" } servo_atoms = { path = "../atoms", optional = true } thin-vec = "0.2" -to_shmem = { path = "../to_shmem" } -to_shmem_derive = { path = "../to_shmem_derive" } +to_shmem = { path = "../to_shmem", package = "stylo_to_shmem" } +to_shmem_derive = { path = "../to_shmem_derive", package = "stylo_to_shmem_derive" } url = { version = "2.5", optional = true } webrender_api = { git = "https://github.com/servo/webrender", branch = "0.65", optional = true } diff --git a/to_shmem/Cargo.toml b/to_shmem/Cargo.toml index d2836df357..0c346f92b9 100644 --- a/to_shmem/Cargo.toml +++ b/to_shmem/Cargo.toml @@ -1,7 +1,9 @@ [package] -name = "to_shmem" +name = "stylo_to_shmem" version = "0.1.0" authors = ["The Servo Project Developers"] +documentation = "https://docs.rs/stylo_to_shmem/" +description = "Support crate for Stylo CSS engine" license = "MPL-2.0" repository = "https://github.com/servo/stylo" edition = "2021" diff --git a/to_shmem_derive/Cargo.toml b/to_shmem_derive/Cargo.toml index db45212d2c..2494a53ff5 100644 --- a/to_shmem_derive/Cargo.toml +++ b/to_shmem_derive/Cargo.toml @@ -1,7 +1,9 @@ [package] -name = "to_shmem_derive" +name = "stylo_to_shmem_derive" version = "0.1.0" authors = ["The Servo Project Developers"] +documentation = "https://docs.rs/stylo_to_shmem_derive/" +description = "Support crate for Stylo CSS engine" license = "MPL-2.0" repository = "https://github.com/servo/stylo" edition = "2021" From 01c1743472b9c2f5ba9a44c9b4ff541f66016044 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 14:43:15 +0100 Subject: [PATCH 05/22] Update metadata for stylo_atoms crate --- atoms/Cargo.toml | 8 +++++--- style/Cargo.toml | 2 +- style_traits/Cargo.toml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/atoms/Cargo.toml b/atoms/Cargo.toml index aa232e86e5..e7b66d7de2 100644 --- a/atoms/Cargo.toml +++ b/atoms/Cargo.toml @@ -1,10 +1,12 @@ [package] -name = "servo_atoms" -version = "0.0.1" +name = "stylo_atoms" +version = "0.1.0" authors = ["The Servo Project Developers"] +documentation = "https://docs.rs/stylo_atoms/" +description = "Support crate for Stylo CSS engine" +repository = "https://github.com/servo/stylo" license = "MPL-2.0" edition = "2018" -publish = false build = "build.rs" [lib] diff --git a/style/Cargo.toml b/style/Cargo.toml index 22d56bfc50..6a8805c3a1 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -85,7 +85,7 @@ rayon-core = "1" selectors = { path = "../selectors" } serde = {version = "1.0", optional = true, features = ["derive"]} servo_arc = { path = "../servo_arc", package = "stylo_arc" } -servo_atoms = {path = "../atoms", optional = true} +servo_atoms = {path = "../atoms", package = "stylo_atoms", optional = true} smallbitvec = "2.3.0" smallvec = "1.0" static_assertions = "1.1" diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index 75a33dbbe5..9dffa15cf2 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -25,7 +25,7 @@ malloc_size_of_derive = "0.1" selectors = { path = "../selectors" } serde = "1.0" servo_arc = { path = "../servo_arc", package = "stylo_arc" } -servo_atoms = { path = "../atoms", optional = true } +servo_atoms = { path = "../atoms", package = "stylo_atoms", optional = true } thin-vec = "0.2" to_shmem = { path = "../to_shmem", package = "stylo_to_shmem" } to_shmem_derive = { path = "../to_shmem_derive", package = "stylo_to_shmem_derive" } From ad67578266913f2b207b3241ad4e81db6bdf6911 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 14:43:40 +0100 Subject: [PATCH 06/22] Duplicate generated counter_styles into atoms crate --- atoms/build.rs | 2 +- atoms/counter_styles.rs | 61 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 atoms/counter_styles.rs diff --git a/atoms/build.rs b/atoms/build.rs index 6bd2de3703..a25ca19f71 100644 --- a/atoms/build.rs +++ b/atoms/build.rs @@ -22,7 +22,7 @@ fn main() { } } } - include!("../style/counter_style/predefined.rs"); + include!("./counter_styles.rs"); atom_type .atoms(static_atoms.lines().map(Result::unwrap)) diff --git a/atoms/counter_styles.rs b/atoms/counter_styles.rs new file mode 100644 index 0000000000..7243e3b3f3 --- /dev/null +++ b/atoms/counter_styles.rs @@ -0,0 +1,61 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +predefined! { + "decimal", + "decimal-leading-zero", + "arabic-indic", + "armenian", + "upper-armenian", + "lower-armenian", + "bengali", + "cambodian", + "khmer", + "cjk-decimal", + "devanagari", + "georgian", + "gujarati", + "gurmukhi", + "hebrew", + "kannada", + "lao", + "malayalam", + "mongolian", + "myanmar", + "oriya", + "persian", + "lower-roman", + "upper-roman", + "tamil", + "telugu", + "thai", + "tibetan", + "lower-alpha", + "lower-latin", + "upper-alpha", + "upper-latin", + "cjk-earthly-branch", + "cjk-heavenly-stem", + "lower-greek", + "hiragana", + "hiragana-iroha", + "katakana", + "katakana-iroha", + "disc", + "circle", + "square", + "disclosure-open", + "disclosure-closed", + "japanese-informal", + "japanese-formal", + "korean-hangul-formal", + "korean-hanja-informal", + "korean-hanja-formal", + "simp-chinese-informal", + "simp-chinese-formal", + "trad-chinese-informal", + "trad-chinese-formal", + "cjk-ideographic", + "ethiopic-numeric", +} From 47836164c1422a62b9ee327b053c38524c37fbd7 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 14:58:16 +0100 Subject: [PATCH 07/22] Add version to dom deps --- malloc_size_of/Cargo.toml | 2 +- style/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index 3ae29a956e..5d595e0d92 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -34,7 +34,7 @@ app_units = "0.7" content-security-policy = { version = "0.5", features = ["serde"], optional = true } crossbeam-channel = { version = "0.5", optional = true } cssparser = "0.34" -dom = { path = "../dom", package = "stylo_dom" } +dom = { path = "../dom", version = "0.1", package = "stylo_dom" } euclid = "0.22" http = { version = "0.2", optional = true } indexmap = { version = "2.2", optional = true } diff --git a/style/Cargo.toml b/style/Cargo.toml index 6a8805c3a1..a43f64dec3 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -58,7 +58,7 @@ bitflags = "2" byteorder = "1.0" cssparser = "0.34" derive_more = { version = "0.99", default-features = false, features = ["add", "add_assign", "deref", "deref_mut", "from"] } -dom = { path = "../dom", package = "stylo_dom" } +dom = { path = "../dom", version = "0.1", package = "stylo_dom" } new_debug_unreachable = "1.0" encoding_rs = {version = "0.8", optional = true} euclid = "0.22" From f41027e1d7af556c074ebf44aaa0eb7d9e1577b4 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:00:20 +0100 Subject: [PATCH 08/22] Add version to stylo_arc deps --- malloc_size_of/Cargo.toml | 2 +- style/Cargo.toml | 2 +- style_traits/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index 5d595e0d92..24f58a4a43 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -42,7 +42,7 @@ keyboard-types = { version = "0.7", optional = true } selectors = { path = "../selectors" } serde = { version = "1.0.195", optional = true } serde_bytes = { version = "0.11", optional = true } -servo_arc = { path = "../servo_arc", package = "stylo_arc" } +servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } smallbitvec = "2.3.0" smallvec = "1.13" string_cache = { version = "0.8", optional = true } diff --git a/style/Cargo.toml b/style/Cargo.toml index a43f64dec3..6451394472 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -84,7 +84,7 @@ rayon = "1" rayon-core = "1" selectors = { path = "../selectors" } serde = {version = "1.0", optional = true, features = ["derive"]} -servo_arc = { path = "../servo_arc", package = "stylo_arc" } +servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } servo_atoms = {path = "../atoms", package = "stylo_atoms", optional = true} smallbitvec = "2.3.0" smallvec = "1.0" diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index 9dffa15cf2..7c8031fdd6 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -24,7 +24,7 @@ malloc_size_of = { path = "../malloc_size_of" } malloc_size_of_derive = "0.1" selectors = { path = "../selectors" } serde = "1.0" -servo_arc = { path = "../servo_arc", package = "stylo_arc" } +servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } servo_atoms = { path = "../atoms", package = "stylo_atoms", optional = true } thin-vec = "0.2" to_shmem = { path = "../to_shmem", package = "stylo_to_shmem" } From 9f49f36bb811299fa4cfd59d9bba41c9e6e97c81 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:01:19 +0100 Subject: [PATCH 09/22] Add version to stylo_to_shmem deps --- style/Cargo.toml | 4 ++-- style_traits/Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/style/Cargo.toml b/style/Cargo.toml index 6451394472..16592c65a2 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -94,8 +94,8 @@ string_cache = { version = "0.8", optional = true } style_config = { path = "../style_config", optional = true } style_derive = {path = "../style_derive"} style_traits = {path = "../style_traits"} -to_shmem = {path = "../to_shmem", package = "stylo_to_shmem"} -to_shmem_derive = {path = "../to_shmem_derive", package = "stylo_to_shmem_derive"} +to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem"} +to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", package = "stylo_to_shmem_derive"} thin-vec = "0.2.1" uluru = "3.0" unicode-bidi = { version = "0.3", default-features = false } diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index 7c8031fdd6..10d3306203 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -27,7 +27,7 @@ serde = "1.0" servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } servo_atoms = { path = "../atoms", package = "stylo_atoms", optional = true } thin-vec = "0.2" -to_shmem = { path = "../to_shmem", package = "stylo_to_shmem" } -to_shmem_derive = { path = "../to_shmem_derive", package = "stylo_to_shmem_derive" } +to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem" } +to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", package = "stylo_to_shmem_derive" } url = { version = "2.5", optional = true } webrender_api = { git = "https://github.com/servo/webrender", branch = "0.65", optional = true } From 981bc38d0f614a3766a66725853ac125db7e2134 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:01:57 +0100 Subject: [PATCH 10/22] Add version to stylo_atoms deps --- style/Cargo.toml | 2 +- style_traits/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/style/Cargo.toml b/style/Cargo.toml index 16592c65a2..f0d0314bfe 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -85,7 +85,7 @@ rayon-core = "1" selectors = { path = "../selectors" } serde = {version = "1.0", optional = true, features = ["derive"]} servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } -servo_atoms = {path = "../atoms", package = "stylo_atoms", optional = true} +servo_atoms = { version = "0.1", path = "../atoms", package = "stylo_atoms", optional = true} smallbitvec = "2.3.0" smallvec = "1.0" static_assertions = "1.1" diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index 10d3306203..84b73f5c86 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -25,7 +25,7 @@ malloc_size_of_derive = "0.1" selectors = { path = "../selectors" } serde = "1.0" servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } -servo_atoms = { path = "../atoms", package = "stylo_atoms", optional = true } +servo_atoms = { version = "0.1", path = "../atoms", package = "stylo_atoms", optional = true } thin-vec = "0.2" to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem" } to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", package = "stylo_to_shmem_derive" } From 26034feef42988198e010cd4f2d7810a02fd0771 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:14:17 +0100 Subject: [PATCH 11/22] Update metadata AND update dep version for stylo_static_prefs --- style/Cargo.toml | 2 +- style_static_prefs/Cargo.toml | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/style/Cargo.toml b/style/Cargo.toml index f0d0314bfe..b5a638db08 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -89,7 +89,7 @@ servo_atoms = { version = "0.1", path = "../atoms", package = "stylo_atoms", opt smallbitvec = "2.3.0" smallvec = "1.0" static_assertions = "1.1" -static_prefs = { path = "../style_static_prefs" } +static_prefs = { version = "0.1", path = "../style_static_prefs", package = "stylo_static_prefs" } string_cache = { version = "0.8", optional = true } style_config = { path = "../style_config", optional = true } style_derive = {path = "../style_derive"} diff --git a/style_static_prefs/Cargo.toml b/style_static_prefs/Cargo.toml index 7a42225d8e..4174a42d6c 100644 --- a/style_static_prefs/Cargo.toml +++ b/style_static_prefs/Cargo.toml @@ -1,7 +1,10 @@ [package] -name = "static_prefs" +name = "stylo_static_prefs" version = "0.1.0" -edition = "2021" authors = ["The Servo Project Developers"] +documentation = "https://docs.rs/stylo_static_prefs/" +description = "Static configuration crate for Stylo CSS engine" +repository = "https://github.com/servo/stylo" +keywords = ["css", "style"] license = "MPL-2.0" -publish = false +edition = "2021" From fccf2c165f8d15f28dc1d71dd524439177781e82 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:17:03 +0100 Subject: [PATCH 12/22] Update metadata AND update dep version for stylo_config --- style/Cargo.toml | 2 +- style_config/Cargo.toml | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/style/Cargo.toml b/style/Cargo.toml index b5a638db08..c6ecc8585e 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -91,7 +91,7 @@ smallvec = "1.0" static_assertions = "1.1" static_prefs = { version = "0.1", path = "../style_static_prefs", package = "stylo_static_prefs" } string_cache = { version = "0.8", optional = true } -style_config = { path = "../style_config", optional = true } +style_config = { version = "0.1", path = "../style_config", package = "stylo_config", optional = true } style_derive = {path = "../style_derive"} style_traits = {path = "../style_traits"} to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem"} diff --git a/style_config/Cargo.toml b/style_config/Cargo.toml index 0076dbf6e8..166206b4a0 100644 --- a/style_config/Cargo.toml +++ b/style_config/Cargo.toml @@ -1,13 +1,16 @@ [package] -name = "style_config" -version = "0.0.1" +name = "stylo_config" +version = "0.1.0" authors = ["The Servo Project Developers"] +documentation = "https://docs.rs/stylo_config/" +description = "Static configuration crate for Stylo CSS engine" +repository = "https://github.com/servo/stylo" +keywords = ["css", "style"] license = "MPL-2.0" edition = "2021" -publish = false [lib] -name = "style_config" +name = "stylo_config" path = "lib.rs" [dependencies] From 0a022122faf8bd35282b1ea8ad636ed5fd9fc8b9 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:23:34 +0100 Subject: [PATCH 13/22] Update metadata for stylo_selectors --- malloc_size_of/Cargo.toml | 2 +- selectors/Cargo.toml | 10 +++++----- style/Cargo.toml | 2 +- style_traits/Cargo.toml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index 24f58a4a43..c549e611fc 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -39,7 +39,7 @@ euclid = "0.22" http = { version = "0.2", optional = true } indexmap = { version = "2.2", optional = true } keyboard-types = { version = "0.7", optional = true } -selectors = { path = "../selectors" } +selectors = { version = "0.26", path = "../selectors", package = "stylo_selectors" } serde = { version = "1.0.195", optional = true } serde_bytes = { version = "0.11", optional = true } servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } diff --git a/selectors/Cargo.toml b/selectors/Cargo.toml index 2bcc577acd..e1a7d8bd90 100644 --- a/selectors/Cargo.toml +++ b/selectors/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "selectors" -version = "0.25.0" +name = "stylo_selectors" +version = "0.26.0" authors = ["The Servo Project Developers"] -documentation = "https://docs.rs/selectors/" -description = "CSS Selectors matching for Rust" +documentation = "https://docs.rs/stylo_selectors/" +description = "Temporary fork of the selectors crate for Stylo" repository = "https://github.com/servo/stylo" readme = "README.md" keywords = ["css", "selectors"] @@ -12,7 +12,7 @@ edition = "2021" build = "build.rs" [lib] -name = "selectors" +name = "stylo_selectors" path = "lib.rs" [features] diff --git a/style/Cargo.toml b/style/Cargo.toml index c6ecc8585e..d706260cfb 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -82,7 +82,7 @@ parking_lot = "0.12" precomputed-hash = "0.1.1" rayon = "1" rayon-core = "1" -selectors = { path = "../selectors" } +selectors = { version = "0.26", path = "../selectors", package = "stylo_selectors" } serde = {version = "1.0", optional = true, features = ["derive"]} servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } servo_atoms = { version = "0.1", path = "../atoms", package = "stylo_atoms", optional = true} diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index 84b73f5c86..9aaa4dcbb5 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -22,7 +22,7 @@ euclid = "0.22" lazy_static = "1" malloc_size_of = { path = "../malloc_size_of" } malloc_size_of_derive = "0.1" -selectors = { path = "../selectors" } +selectors = { version = "0.26", path = "../selectors", package = "stylo_selectors" } serde = "1.0" servo_arc = { path = "../servo_arc", version = "0.4", package = "stylo_arc" } servo_atoms = { version = "0.1", path = "../atoms", package = "stylo_atoms", optional = true } From 8beff95581597b484ebd57ad081a718dda9a8fa9 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:34:14 +0100 Subject: [PATCH 14/22] Update metadata for stylo_malloc_size_of crate --- malloc_size_of/Cargo.toml | 10 ++++++---- style/Cargo.toml | 2 +- style_traits/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index c549e611fc..39e67d3ac0 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -1,11 +1,13 @@ [package] -name = "malloc_size_of" -version = "0.0.1" +name = "stylo_malloc_size_of" +version = "0.1.0" authors = ["The Servo Project Developers"] -license = "MIT OR Apache-2.0" +documentation = "https://docs.rs/stylo_malloc_size_of/" +description = "Support crate for Stylo CSS engine" repository = "https://github.com/servo/stylo" +keywords = ["css", "style"] +license = "MPL-2.0" edition = "2021" -publish = false [lib] path = "lib.rs" diff --git a/style/Cargo.toml b/style/Cargo.toml index d706260cfb..53114a3ea3 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -69,7 +69,7 @@ itertools = "0.10" itoa = "1.0" lazy_static = "1" log = "0.4" -malloc_size_of = { path = "../malloc_size_of" } +malloc_size_of = { version = "0.1", path = "../malloc_size_of", package = "stylo_malloc_size_of" } malloc_size_of_derive = "0.1" markup5ever = { version = "0.14", optional = true } matches = "0.1" diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index 9aaa4dcbb5..621c33db20 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -20,7 +20,7 @@ bitflags = "2" cssparser = "0.34" euclid = "0.22" lazy_static = "1" -malloc_size_of = { path = "../malloc_size_of" } +malloc_size_of = { version = "0.1", path = "../malloc_size_of", package = "stylo_malloc_size_of" } malloc_size_of_derive = "0.1" selectors = { version = "0.26", path = "../selectors", package = "stylo_selectors" } serde = "1.0" From 8182346fd1fbbb49db65d5aa264096a8bf6a8ad3 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:39:16 +0100 Subject: [PATCH 15/22] Remove webrender_api dep from malloc_size_of --- malloc_size_of/Cargo.toml | 2 -- malloc_size_of/lib.rs | 40 --------------------------------------- 2 files changed, 42 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index 39e67d3ac0..90c8a2db60 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -25,7 +25,6 @@ servo = [ "string_cache", "url", "uuid", - "webrender_api", "xml5ever", ] gecko = ["thin-vec/gecko-ffi"] @@ -53,5 +52,4 @@ tokio = { version = "1", features = ["sync"] } url = { version = "2.5", features = ["serde"], optional = true } uuid = { version = "1.7.0", optional = true } void = "1.0.2" -webrender_api = { git = "https://github.com/servo/webrender", branch = "0.65", optional = true } xml5ever = { version = "0.20", optional = true } diff --git a/malloc_size_of/lib.rs b/malloc_size_of/lib.rs index 019d01d7a2..a890b5770e 100644 --- a/malloc_size_of/lib.rs +++ b/malloc_size_of/lib.rs @@ -849,46 +849,6 @@ impl MallocSizeOf for url::Host { } } } -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::BorderRadius); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::BorderStyle); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::BoxShadowClipMode); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::ColorF); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::ComplexClipRegion); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::ExtendMode); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::FilterOp); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::ExternalScrollId); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::FontInstanceKey); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::GradientStop); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::GlyphInstance); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::NinePatchBorder); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::ImageKey); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::ImageRendering); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::LineStyle); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::MixBlendMode); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::NormalBorder); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::RepeatMode); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::StickyOffsetBounds); -#[cfg(feature = "webrender_api")] -malloc_size_of_is_0!(webrender_api::TransformStyle); #[cfg(feature = "servo")] impl MallocSizeOf for keyboard_types::Key { From e3f90311f771fd0ee0daa2199671f1d4d9da39d1 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:42:04 +0100 Subject: [PATCH 16/22] Remove webrender_api dep from style_traits --- style_traits/Cargo.toml | 3 +-- style_traits/lib.rs | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index 621c33db20..fd32db2fa0 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -11,7 +11,7 @@ name = "style_traits" path = "lib.rs" [features] -servo = ["servo_atoms", "cssparser/serde", "webrender_api", "url", "euclid/serde"] +servo = ["servo_atoms", "cssparser/serde", "url", "euclid/serde"] gecko = [] [dependencies] @@ -30,4 +30,3 @@ thin-vec = "0.2" to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem" } to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", package = "stylo_to_shmem_derive" } url = { version = "2.5", optional = true } -webrender_api = { git = "https://github.com/servo/webrender", branch = "0.65", optional = true } diff --git a/style_traits/lib.rs b/style_traits/lib.rs index 1e7791da73..77e436354a 100644 --- a/style_traits/lib.rs +++ b/style_traits/lib.rs @@ -33,11 +33,7 @@ extern crate to_shmem; #[macro_use] extern crate to_shmem_derive; #[cfg(feature = "servo")] -extern crate webrender_api; -#[cfg(feature = "servo")] extern crate url; -#[cfg(feature = "servo")] -pub use webrender_api::units::DevicePixel; use cssparser::{CowRcStr, Token}; use selectors::parser::SelectorParseErrorKind; @@ -47,7 +43,6 @@ use servo_atoms::Atom; /// One hardware pixel. /// /// This unit corresponds to the smallest addressable element of the display hardware. -#[cfg(not(feature = "servo"))] #[derive(Clone, Copy, Debug)] pub enum DevicePixel {} From ea5420e19ebab325290e37c87c9d11e355ba4532 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:46:13 +0100 Subject: [PATCH 17/22] Update metadata for stylo_traits crate --- style/Cargo.toml | 2 +- style_traits/Cargo.toml | 13 ++++++++----- style_traits/lib.rs | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/style/Cargo.toml b/style/Cargo.toml index 53114a3ea3..f7d1ae49d1 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -93,7 +93,7 @@ static_prefs = { version = "0.1", path = "../style_static_prefs", package = "sty string_cache = { version = "0.8", optional = true } style_config = { version = "0.1", path = "../style_config", package = "stylo_config", optional = true } style_derive = {path = "../style_derive"} -style_traits = {path = "../style_traits"} +style_traits = { version = "0.1", path = "../style_traits", package = "stylo_traits" } to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem"} to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", package = "stylo_to_shmem_derive"} thin-vec = "0.2.1" diff --git a/style_traits/Cargo.toml b/style_traits/Cargo.toml index fd32db2fa0..446289429b 100644 --- a/style_traits/Cargo.toml +++ b/style_traits/Cargo.toml @@ -1,13 +1,16 @@ [package] -name = "style_traits" -version = "0.0.1" +name = "stylo_traits" +version = "0.1.0" authors = ["The Servo Project Developers"] -license = "MPL-2.0" +documentation = "https://docs.rs/stylo_traits/" +description = "Vocabulary types for the Stylo CSS engine" repository = "https://github.com/servo/stylo" -publish = false +keywords = ["css", "style"] +license = "MPL-2.0" +edition = "2015" [lib] -name = "style_traits" +name = "stylo_traits" path = "lib.rs" [features] diff --git a/style_traits/lib.rs b/style_traits/lib.rs index 77e436354a..032b338203 100644 --- a/style_traits/lib.rs +++ b/style_traits/lib.rs @@ -6,7 +6,7 @@ //! The traits are here instead of in script so that the devtools crate can be //! modified independently of the rest of Servo. -#![crate_name = "style_traits"] +#![crate_name = "stylo_traits"] #![crate_type = "rlib"] #![deny(unsafe_code, missing_docs)] From 1be671c7ef4b5554ffa40837c7cc9a3f3a56a3ea Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 15:51:16 +0100 Subject: [PATCH 18/22] Update metadata for stylo_derive crate --- style/Cargo.toml | 2 +- style_derive/Cargo.toml | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/style/Cargo.toml b/style/Cargo.toml index f7d1ae49d1..f57583327c 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -92,7 +92,7 @@ static_assertions = "1.1" static_prefs = { version = "0.1", path = "../style_static_prefs", package = "stylo_static_prefs" } string_cache = { version = "0.8", optional = true } style_config = { version = "0.1", path = "../style_config", package = "stylo_config", optional = true } -style_derive = {path = "../style_derive"} +style_derive = { version = "0.1", path = "../style_derive", package = "stylo_derive" } style_traits = { version = "0.1", path = "../style_traits", package = "stylo_traits" } to_shmem = { version = "0.1", path = "../to_shmem", package = "stylo_to_shmem"} to_shmem_derive = { version = "0.1", path = "../to_shmem_derive", package = "stylo_to_shmem_derive"} diff --git a/style_derive/Cargo.toml b/style_derive/Cargo.toml index 2148f4e48a..6f3e6027ed 100644 --- a/style_derive/Cargo.toml +++ b/style_derive/Cargo.toml @@ -1,10 +1,13 @@ [package] -name = "style_derive" -version = "0.0.1" +name = "stylo_derive" +version = "0.1.0" authors = ["The Servo Project Developers"] -license = "MPL-2.0" +documentation = "https://docs.rs/stylo_derive/" +description = "Derive crate for Stylo CSS engine" repository = "https://github.com/servo/stylo" -publish = false +keywords = ["css", "style"] +license = "MPL-2.0" +edition = "2015" [lib] path = "lib.rs" From 16cf9b2e4b683577cb4063c18ebdde232ad32ebf Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 16:01:29 +0100 Subject: [PATCH 19/22] Update metadata for stylo crate --- style/Cargo.toml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/style/Cargo.toml b/style/Cargo.toml index f57583327c..f6d667574d 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -1,11 +1,12 @@ [package] -name = "style" -version = "0.0.1" +name = "stylo" +version = "0.1.0" authors = ["The Servo Project Developers"] -license = "MPL-2.0" +documentation = "https://docs.rs/stylo/" +description = "The Stylo CSS engine (used in Servo and Gecko)" repository = "https://github.com/servo/stylo" -publish = false - +keywords = ["css", "style"] +license = "MPL-2.0" build = "build.rs" edition = "2018" @@ -13,7 +14,7 @@ edition = "2018" links = "servo_style_crate" [lib] -name = "style" +name = "stylo" path = "lib.rs" doctest = false From 2c691036768663892c0e51d734bc4e34e146c57b Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 16:01:48 +0100 Subject: [PATCH 20/22] Make "servo" feature a default feature for stylo crate --- style/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/style/Cargo.toml b/style/Cargo.toml index f6d667574d..f54be9a3e3 100644 --- a/style/Cargo.toml +++ b/style/Cargo.toml @@ -19,6 +19,7 @@ path = "lib.rs" doctest = false [features] +default = ["servo"] gecko = [ "bindgen", "malloc_size_of/gecko", From eaa58f59be86c74949500f8f0b0266b475fb0ea3 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 16:05:27 +0100 Subject: [PATCH 21/22] Copy README into stylo crate --- style/README.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 4 deletions(-) diff --git a/style/README.md b/style/README.md index bdbe36e44c..685bcf27ae 100644 --- a/style/README.md +++ b/style/README.md @@ -1,6 +1,88 @@ -servo-style -=========== +Stylo +===== -Style system for Servo, using [rust-cssparser](https://github.com/servo/rust-cssparser) for parsing. +This repo contains Servo’s downstream fork of [Stylo](https://searchfox.org/mozilla-central/source/servo), the CSS engine used by Servo and Firefox (Gecko). Stylo is a full CSS engine that implements both parsing and style resolution. - * [Documentation](https://github.com/servo/servo/blob/main/docs/components/style.md). +The branches are as follows: + +- [`upstream`](https://github.com/servo/style/tree/upstream) has upstream mozilla-central filtered to the paths we care about ([style.paths](style.paths)), but is otherwise unmodified +- [`main`](https://github.com/servo/style/tree/ci) has our downstream patches, plus the scripts and workflows for syncing with mozilla-central, to be rebased onto `upstream` + +## Building Servo against your local Stylo + +Assuming your local `servo` and `stylo` directories are siblings, you can build `servo` against `stylo` by adding the following to `servo/Cargo.toml`: + +```toml +[patch."https://github.com/servo/stylo.git"] +derive_common = { path = "../stylo/derive_common" } +malloc_size_of = { path = "../stylo/malloc_size_of" } +selectors = { path = "../stylo/selectors" } +servo_arc = { path = "../stylo/servo_arc" } +servo_atoms = { path = "../stylo/atoms" } +size_of_test = { path = "../stylo/size_of_test" } +static_prefs = { path = "../stylo/style_static_prefs" } +style_config = { path = "../stylo/style_config" } +style_derive = { path = "../stylo/style_derive" } +style = { path = "../stylo/style" } +style_traits = { path = "../stylo/style_traits" } +``` + +## Syncing `upstream` with mozilla-central + +Start by generating a filtered copy of mozilla-central. This will cache the raw mozilla-central in `_cache/upstream`, storing the result in `_filtered`: + +```sh +$ ./sync.sh _filtered +``` + +If `_filtered` already exists, you will need to delete it and try again: + +```sh +$ rm -Rf _filtered +``` + +Now overwrite our `upstream` with those commits and push: + +```sh +$ git fetch -f --progress ./_filtered master:upstream +$ git push -fu --progress origin upstream +``` + +## Rebasing `main` onto `upstream` + +Start by fetching `upstream` into your local repo: + +```sh +$ git fetch -f origin upstream:upstream +``` + +In general, the filtering process is deterministic, yielding the same commit hashes each time, so we can rebase normally: + +```sh +$ git rebase upstream +``` + +But if the filtering config changes or Mozilla moves to GitHub, the commit hashes on `upstream` may change. In this case, we need to tell git where the old upstream ends and our own commits start (notice the `~`): + +```sh +$ git log --pretty=\%H --grep='Servo initial downstream commit' +e62d7f0090941496e392e1dc91df103a38e3f488 + +$ git rebase --onto upstream e62d7f0090941496e392e1dc91df103a38e3f488~ +Successfully rebased and updated refs/heads/main. +``` + +`start-rebase.sh` takes care of this automatically, but you should still use `git rebase` for subsequent steps like `--continue` and `--abort`: + +```sh +$ ./start-rebase.sh upstream +$ ./start-rebase.sh upstream -i # interactive +$ git rebase --continue # not ./start-rebase.sh --continue +$ git rebase --abort # not ./start-rebase.sh --abort +``` + +Or if we aren’t ready to rebase onto the tip of upstream: + +```sh +$ ./start-rebase.sh upstream~10 -i +``` From 483ac96cc8de7bbefc0f6e9e3e6da3c8741f5957 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 12 Oct 2024 16:09:55 +0100 Subject: [PATCH 22/22] Correct licence for stylo_malloc_size_of --- malloc_size_of/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/malloc_size_of/Cargo.toml b/malloc_size_of/Cargo.toml index 90c8a2db60..11e5979c39 100644 --- a/malloc_size_of/Cargo.toml +++ b/malloc_size_of/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "stylo_malloc_size_of" -version = "0.1.0" +version = "0.1.1" authors = ["The Servo Project Developers"] documentation = "https://docs.rs/stylo_malloc_size_of/" description = "Support crate for Stylo CSS engine" repository = "https://github.com/servo/stylo" keywords = ["css", "style"] -license = "MPL-2.0" +license = "MIT OR Apache-2.0" edition = "2021" [lib]