From 9b7b97b2f6ed54601dae555756b85fa93977bef0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 7 Jan 2024 11:19:28 +0100 Subject: [PATCH] LibWeb/CSS: Revert to PercentageOr::resolve() to be templated In 4bc38300ad9e7ca7665bd6afa0ab9c0557807286 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. --- Userland/Libraries/LibWeb/CSS/PercentageOr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/PercentageOr.h b/Userland/Libraries/LibWeb/CSS/PercentageOr.h index 7fb33fa569..77046ac22c 100644 --- a/Userland/Libraries/LibWeb/CSS/PercentageOr.h +++ b/Userland/Libraries/LibWeb/CSS/PercentageOr.h @@ -100,7 +100,8 @@ public: 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) { return m_value.visit( [&](T const& t) {