diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs
index ce285c4d71b..0b9dcd11217 100644
--- a/components/style/properties.mako.rs
+++ b/components/style/properties.mako.rs
@@ -6722,10 +6722,8 @@ pub type CascadePropertyFn =
cacheable: &mut bool,
error_reporter: &mut Box);
-// This is a thread-local rather than a lazy static to avoid atomic operations when cascading
-// properties.
-thread_local!(static CASCADE_PROPERTY: Vec>> = {
- let mut result: Vec >> = Vec::new();
+pub fn make_cascade_vec() -> Vec>> {
+ let mut result: Vec >> = Vec::new();
% for style_struct in STYLE_STRUCTS:
% for property in style_struct.longhands:
let discriminant;
@@ -6741,6 +6739,12 @@ thread_local!(static CASCADE_PROPERTY: Vec >> = {
+ make_cascade_vec::()
});
/// Performs the CSS cascade, computing new styles for an element from its parent style and
diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs
index 38e3b0ead44..94407b18c8f 100644
--- a/ports/geckolib/properties.mako.rs
+++ b/ports/geckolib/properties.mako.rs
@@ -19,6 +19,7 @@ use style::custom_properties::ComputedValuesMap;
use style::logical_geometry::WritingMode;
use style::properties::{CascadePropertyFn, ServoComputedValues, ComputedValues};
use style::properties::longhands;
+use style::properties::make_cascade_vec;
use style::properties::style_struct_traits::*;
#[derive(Clone)]
@@ -63,8 +64,8 @@ impl ComputedValues for GeckoComputedValues {
fn initial_values() -> &'static Self { &*INITIAL_GECKO_VALUES }
- fn do_cascade_property>>)>(_: F) {
- unimplemented!()
+ fn do_cascade_property>>)>(f: F) {
+ CASCADE_PROPERTY.with(|x| f(x));
}
% for style_struct in STYLE_STRUCTS:
@@ -229,3 +230,9 @@ lazy_static! {
root_font_size: longhands::font_size::get_initial_value(),
};
}
+
+// This is a thread-local rather than a lazy static to avoid atomic operations when cascading
+// properties.
+thread_local!(static CASCADE_PROPERTY: Vec>> = {
+ make_cascade_vec::()
+});