diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /servo/components/style/custom_properties.rs | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-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.rs | 9 |
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, |