mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 16:58:58 +00:00
LibWeb: Remove unused ComputedProperties::resolve_opacity_value
This commit is contained in:
parent
5a7eaf6f73
commit
f061f565b9
Notes:
github-actions[bot]
2025-09-08 10:06:38 +00:00
Author: https://github.com/Calme1709
Commit: f061f565b9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6112
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 0 additions and 29 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue