mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +00:00
LibWeb/CSS: Replace resolve_percentage_deprecated() with undeprecated
This commit is contained in:
parent
0dba531772
commit
995b7eb7b4
Notes:
github-actions[bot]
2025-09-24 15:36:24 +00:00
Author: https://github.com/AtkinsSJ
Commit: 995b7eb7b4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6290
Reviewed-by: https://github.com/tcl3 ✅
6 changed files with 4 additions and 13 deletions
|
@ -106,7 +106,7 @@ NonnullRefPtr<StyleValue const> NumberOrCalculated::create_style_value() const
|
|||
|
||||
Optional<Percentage> PercentageOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue const> const& calculated, CalculationResolutionContext const& context) const
|
||||
{
|
||||
return calculated->resolve_percentage_deprecated(context);
|
||||
return calculated->resolve_percentage(context);
|
||||
}
|
||||
|
||||
NonnullRefPtr<StyleValue const> PercentageOrCalculated::create_style_value() const
|
||||
|
|
|
@ -64,7 +64,7 @@ ParsedFontFace ParsedFontFace::from_descriptors(CSSFontFaceDescriptors const& de
|
|||
return value.as_percentage().percentage();
|
||||
if (value.is_calculated()) {
|
||||
// FIXME: These should probably be simplified already?
|
||||
return value.as_calculated().resolve_percentage_deprecated({});
|
||||
return value.as_calculated().resolve_percentage({});
|
||||
}
|
||||
if (value.to_keyword() == Keyword::Normal)
|
||||
return {};
|
||||
|
|
|
@ -191,7 +191,7 @@ Parser::ParseErrorOr<NonnullRefPtr<StyleValue const>> Parser::parse_descriptor_v
|
|||
}
|
||||
// All calculations in descriptors must be resolvable at parse-time.
|
||||
if (percentage_value->is_calculated()) {
|
||||
auto percentage = percentage_value->as_calculated().resolve_percentage_deprecated({});
|
||||
auto percentage = percentage_value->as_calculated().resolve_percentage({});
|
||||
if (percentage.has_value() && percentage->value() >= 0)
|
||||
return PercentageStyleValue::create(percentage.release_value());
|
||||
return nullptr;
|
||||
|
|
|
@ -3029,14 +3029,6 @@ Optional<Length> CalculatedStyleValue::resolve_length(CalculationResolutionConte
|
|||
return {};
|
||||
}
|
||||
|
||||
Optional<Percentage> CalculatedStyleValue::resolve_percentage_deprecated(CalculationResolutionContext const& context) const
|
||||
{
|
||||
auto result = m_calculation->resolve(context);
|
||||
if (result.type().has_value() && result.type()->matches_percentage())
|
||||
return Percentage { result.value() };
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<Percentage> CalculatedStyleValue::resolve_percentage(CalculationResolutionContext const& context) const
|
||||
{
|
||||
auto result = resolve_value(context);
|
||||
|
|
|
@ -92,7 +92,6 @@ public:
|
|||
Optional<Length> resolve_length(CalculationResolutionContext const&) const;
|
||||
|
||||
bool resolves_to_percentage() const { return m_resolved_type.matches_percentage(); }
|
||||
Optional<Percentage> resolve_percentage_deprecated(CalculationResolutionContext const&) const;
|
||||
Optional<Percentage> resolve_percentage(CalculationResolutionContext const&) const;
|
||||
|
||||
bool resolves_to_resolution() const { return m_resolved_type.matches_resolution(m_context.percentages_resolve_as); }
|
||||
|
|
|
@ -37,7 +37,7 @@ float FilterOperation::Color::resolved_amount() const
|
|||
return amount.calculated()->resolve_number(context).value();
|
||||
|
||||
if (amount.calculated()->resolves_to_percentage())
|
||||
return amount.calculated()->resolve_percentage_deprecated(context)->as_fraction();
|
||||
return amount.calculated()->resolve_percentage(context)->as_fraction();
|
||||
}
|
||||
|
||||
VERIFY_NOT_REACHED();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue