summaryrefslogtreecommitdiffstats
path: root/servo/components/style/custom_properties.rs
diff options
context:
space:
mode:
Diffstat (limited to 'servo/components/style/custom_properties.rs')
-rw-r--r--servo/components/style/custom_properties.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/servo/components/style/custom_properties.rs b/servo/components/style/custom_properties.rs
index 766fe530d9..3a7beff90a 100644
--- a/servo/components/style/custom_properties.rs
+++ b/servo/components/style/custom_properties.rs
@@ -274,6 +274,11 @@ impl ComputedCustomProperties {
name: &Name,
value: ComputedRegisteredValue,
) {
+ // Broadening the assert to
+ // registration.syntax.is_universal() ^ value.as_universal().is_none() would require
+ // rewriting the cascade to not temporarily store unparsed custom properties with references
+ // as universal in the custom properties map.
+ debug_assert!(!registration.syntax.is_universal() || value.as_universal().is_some());
self.map_mut(registration).insert(name, value)
}
@@ -1925,13 +1930,13 @@ fn do_substitute_chunk<'a>(
computed_context,
references,
)?;
+ let substitution = substitution.into_universal();
// Optimize the property: var(--...) case to avoid allocating at all.
if reference.start == start && reference.end == end && registration.syntax.is_universal() {
- return Ok(substitution);
+ return Ok(Substitution::Universal(substitution));
}
- let substitution = substitution.into_universal();
substituted.push(
&substitution.css,
substitution.first_token_type,