From 7d72d7c385f385e6fa4515342166d1acf884cf44 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Tue, 21 Nov 2023 13:04:26 +0100 Subject: [PATCH] Further changes required by Servo --- components/style/driver.rs | 5 ++++- components/style/parallel.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/style/driver.rs b/components/style/driver.rs index c02924b73b3..c6011b6c5a0 100644 --- a/components/style/driver.rs +++ b/components/style/driver.rs @@ -49,7 +49,10 @@ fn report_statistics(stats: &PerThreadTraversalStatistics) { } fn parallelism_threshold() -> usize { - static_prefs::pref!("layout.css.stylo-parallelism-threshold") as usize + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.stylo-parallelism-threshold") as usize; + #[cfg(feature = "servo")] + return 16; } /// Do a DOM traversal for top-down and (optionally) bottom-up processing, generic over `D`. diff --git a/components/style/parallel.rs b/components/style/parallel.rs index 815393d050d..d6045ff3802 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -59,7 +59,10 @@ pub const STACK_SAFETY_MARGIN_KB: usize = 168; /// See documentation of the pref for performance characteristics. pub fn work_unit_max() -> usize { - static_prefs::pref!("layout.css.stylo-work-unit-size") as usize + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.stylo-work-unit-size") as usize; + #[cfg(feature = "servo")] + return 16; } /// A callback to create our thread local context. This needs to be