1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

LibWeb/CSS: Revert to PercentageOr::resolve() to be templated

In 4bc38300ad this function was modified
to accept only Angle instead of being templated, with the purpose of
preventing Length from being passed.

This change reverts the function to being templated but adds a
constraint specifically forbidding Length. This adjustment will allow
for the future use of Frequency, Number, Time, etc., if we would want.
This commit is contained in:
Aliaksandr Kalenik 2024-01-07 11:19:28 +01:00 committed by Andreas Kling
parent be7538961b
commit 9b7b97b2f6

View file

@ -100,7 +100,8 @@ public:
return resolved(layout_node, reference_value).to_px(layout_node); return resolved(layout_node, reference_value).to_px(layout_node);
} }
Angle resolved(Layout::Node const& layout_node, Angle reference_value) const T resolved(Layout::Node const& layout_node, T reference_value) const
requires(!IsSame<T, Length>)
{ {
return m_value.visit( return m_value.visit(
[&](T const& t) { [&](T const& t) {