diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 89e9d1d2b2e6..f072da97c8f6 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -210,6 +210,7 @@ #[allow(unused_variables)] pub fn cascade_property(declaration: &PropertyDeclaration, inherited_style: &ComputedValues, + default_style: &Arc, context: &mut computed::Context, seen: &mut PropertyBitField, cacheable: &mut bool, @@ -260,7 +261,7 @@ DeclaredValue::Initial => { // We assume that it's faster to use copy_*_from rather than // set_*(get_initial_value()); - let initial_struct = ComputedValues::initial_values() + let initial_struct = default_style .get_${data.current_style_struct.name_lower}(); context.mutate_style().mutate_${data.current_style_struct.name_lower}() .copy_${property.ident}_from(initial_struct ${maybe_wm}); diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index d5d068060bf0..d3a84e857c01 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1668,6 +1668,7 @@ mod lazy_static_module { pub type CascadePropertyFn = extern "Rust" fn(declaration: &PropertyDeclaration, inherited_style: &ComputedValues, + default_style: &Arc, context: &mut computed::Context, seen: &mut PropertyBitField, cacheable: &mut bool, @@ -1875,6 +1876,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D, let discriminant = longhand_id as usize; (CASCADE_PROPERTY[discriminant])(declaration, inherited_style, + default_style, &mut context, &mut seen, &mut cacheable,