LibWeb: Resolve percentages for opacity properties at parse time

This commit is contained in:
Tim Ledbetter 2025-06-18 17:44:58 +01:00 committed by Jelle Raaijmakers
commit 269d5bb40e
Notes: github-actions[bot] 2025-06-19 08:28:47 +00:00
6 changed files with 87 additions and 4 deletions

View file

@ -377,8 +377,6 @@ float ComputedProperties::resolve_opacity_value(CSSStyleValue const& value)
else
dbgln("Unable to resolve calc() as opacity (number): {}", value.to_string(SerializationMode::Normal));
}
} else if (value.is_percentage()) {
unclamped_opacity = value.as_percentage().percentage().as_fraction();
}
return clamp(unclamped_opacity, 0.0f, 1.0f);