diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index 90dec0a47d7..d51701b2ced 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -778,6 +778,7 @@ impl PropertyDeclarationBlock { dest: &mut CssStringWriter, computed_values: Option<&ComputedValues>, custom_properties_block: Option<&PropertyDeclarationBlock>, + environment: &CssEnvironment, ) -> fmt::Result { if let Ok(shorthand) = property.as_shorthand() { return self.shorthand_to_css(shorthand, dest); @@ -790,19 +791,13 @@ impl PropertyDeclarationBlock { None => return Err(fmt::Error), }; - // TODO(emilio): When we implement any environment variable without - // hard-coding the values we're going to need to get something - // meaningful out of here... All this code path is so terribly hacky - // ;_;. - let env = CssEnvironment; - let custom_properties = if let Some(cv) = computed_values { // If there are extra custom properties for this declaration block, // factor them in too. if let Some(block) = custom_properties_block { // FIXME(emilio): This is not super-efficient here, and all this // feels like a hack anyway... - block.cascade_custom_properties(cv.custom_properties(), &env) + block.cascade_custom_properties(cv.custom_properties(), environment) } else { cv.custom_properties().cloned() } @@ -825,7 +820,7 @@ impl PropertyDeclarationBlock { declaration.id, custom_properties.as_ref(), QuirksMode::NoQuirks, - &env, + environment, ) .to_css(dest) },