mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb: Add method to absolutize CalculatedOr
This commit is contained in:
parent
0df9c225aa
commit
c8bd58c0ba
|
|
@ -78,6 +78,20 @@ public:
|
|||
});
|
||||
}
|
||||
|
||||
Self absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
|
||||
{
|
||||
return m_value.visit(
|
||||
[&](T const& value) {
|
||||
if constexpr (IsSame<T, Length>)
|
||||
return Self { value.absolutized(viewport_rect, font_metrics, root_font_metrics) };
|
||||
else
|
||||
return *static_cast<Self const*>(this);
|
||||
},
|
||||
[&](NonnullRefPtr<CalculatedStyleValue const> const& value) {
|
||||
return Self { value->absolutized(viewport_rect, font_metrics, root_font_metrics)->as_calculated() };
|
||||
});
|
||||
}
|
||||
|
||||
bool operator==(CalculatedOr<Self, T> const& other) const
|
||||
{
|
||||
if (is_calculated() || other.is_calculated())
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user