diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 31c3dc207f5..c1d337ac2fa 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -109,7 +109,7 @@ pub struct VariableValue { references_environment: bool, /// Custom property names in var() functions. - references: PrecomputedHashSet, + references: Box<[Name]>, } impl ToCss for SpecifiedValue { @@ -278,7 +278,7 @@ impl VariableValue { css: String::new(), last_token_type: TokenSerializationType::nothing(), first_token_type: TokenSerializationType::nothing(), - references: PrecomputedHashSet::default(), + references: Default::default(), references_environment: false, } } @@ -335,11 +335,16 @@ impl VariableValue { let (first_token_type, css, last_token_type) = parse_self_contained_declaration_value(input, Some(&mut references))?; + let custom_property_references = references.custom_property_references + .into_iter() + .collect::>() + .into_boxed_slice(); + Ok(Arc::new(VariableValue { css: css.into_owned(), first_token_type, last_token_type, - references: references.custom_property_references, + references: custom_property_references, references_environment: references.references_environment, })) }