summaryrefslogtreecommitdiffstats
path: root/servo/components/style/custom_properties.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /servo/components/style/custom_properties.rs
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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,