diff --git a/Libraries/LibWeb/CSS/ComputedProperties.cpp b/Libraries/LibWeb/CSS/ComputedProperties.cpp index 27d470bfc1d..7fcc75d3825 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.cpp +++ b/Libraries/LibWeb/CSS/ComputedProperties.cpp @@ -445,33 +445,6 @@ Optional 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(); diff --git a/Libraries/LibWeb/CSS/ComputedProperties.h b/Libraries/LibWeb/CSS/ComputedProperties.h index 042f3649ca2..cd7d733dd87 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.h +++ b/Libraries/LibWeb/CSS/ComputedProperties.h @@ -249,8 +249,6 @@ public: static NonnullRefPtr 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);