Bug 1910646 - Do not assert that variables are computed before substituting references. r=firefox-style-system-reviewers,emilio

If the value of a custom property is a CSS-wide keyword in fallback, it
will not already be computed.

Differential Revision: https://phabricator.services.mozilla.com/D241773
This commit is contained in:
Zach Hoffman
2025-03-17 18:49:32 +00:00
parent 362530a25c
commit e4625509a6
3 changed files with 0 additions and 10 deletions

View File

@@ -2057,8 +2057,6 @@ fn substitute_one_reference<'a>(
if reference.is_var {
let registration = stylist.get_custom_property_registration(&reference.name);
if let Some(v) = custom_properties.get(registration, &reference.name) {
#[cfg(debug_assertions)]
debug_assert!(v.is_parsed(registration), "Should be already computed");
// Skip references that are inside the outer variable (in fallback for example).
while references
.next_if(|next_ref| next_ref.end <= reference.end)

View File

@@ -343,12 +343,6 @@ impl ComputedValue {
}
}
/// Returns whether the the property is computed.
#[cfg(debug_assertions)]
pub fn is_parsed(&self, registration: &PropertyRegistrationData) -> bool {
registration.syntax.is_universal() || !matches!(self.v, ValueInner::Universal(_))
}
/// Convert to an untyped variable value.
pub fn to_variable_value(&self) -> ComputedPropertyValue {
if let ValueInner::Universal(ref value) = self.v {

View File

@@ -1,6 +1,4 @@
[variable-css-wide-keywords.html]
expected:
if debug: CRASH
[`revert-layer` as a `var()` fallback for an unregistered custom property]
expected: FAIL