LibWeb: Remove unused ComputedProperties::resolve_opacity_value

This commit is contained in:
Callum Law 2025-09-08 00:17:24 +12:00 committed by Tim Ledbetter
commit f061f565b9
Notes: github-actions[bot] 2025-09-08 10:06:38 +00:00
2 changed files with 0 additions and 29 deletions

View file

@ -445,33 +445,6 @@ Optional<int> ComputedProperties::z_index() const
return {};
}
float ComputedProperties::resolve_opacity_value(StyleValue const& value)
{
float unclamped_opacity = 1.0f;
if (value.is_number()) {
unclamped_opacity = value.as_number().number();
} else if (value.is_calculated()) {
auto const& calculated = value.as_calculated();
CalculationResolutionContext context {};
if (calculated.resolves_to_percentage()) {
auto maybe_percentage = value.as_calculated().resolve_percentage_deprecated(context);
if (maybe_percentage.has_value())
unclamped_opacity = maybe_percentage->as_fraction();
else
dbgln("Unable to resolve calc() as opacity (percentage): {}", value.to_string(SerializationMode::Normal));
} else if (calculated.resolves_to_number()) {
auto maybe_number = value.as_calculated().resolve_number_deprecated(context);
if (maybe_number.has_value())
unclamped_opacity = maybe_number.value();
else
dbgln("Unable to resolve calc() as opacity (number): {}", value.to_string(SerializationMode::Normal));
}
}
return clamp(unclamped_opacity, 0.0f, 1.0f);
}
float ComputedProperties::opacity() const
{
return property(PropertyID::Opacity).as_number().number();

View file

@ -249,8 +249,6 @@ public:
static NonnullRefPtr<Gfx::Font const> font_fallback(bool monospace, bool bold, float point_size);
static float resolve_opacity_value(StyleValue const& value);
bool has_attempted_match_against_pseudo_class(PseudoClass pseudo_class) const
{
return m_attempted_pseudo_class_matches.get(pseudo_class);