diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index 010246a27fb..c06104b9668 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -19,14 +19,6 @@ namespace Web::Layout { -// NOTE: We use a custom clamping function here instead of AK::clamp(), since the AK version -// will VERIFY(max >= min) and CSS explicitly allows that (see css-values-4.) -template -[[nodiscard]] constexpr T css_clamp(T const& value, T const& min, T const& max) -{ - return ::max(min, ::min(value, max)); -} - CSSPixels FlexFormattingContext::get_pixel_width(Box const& box, CSS::Size const& size) const { return calculate_inner_width(box, containing_block_width_as_available_size(box), size); diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.h b/Userland/Libraries/LibWeb/Layout/FormattingContext.h index de41eb7be66..c88d3645a85 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.h @@ -13,6 +13,14 @@ namespace Web::Layout { +// NOTE: We use a custom clamping function here instead of AK::clamp(), since the AK version +// will VERIFY(max >= min) and CSS explicitly allows that (see css-values-4.) +template +[[nodiscard]] constexpr T css_clamp(T const& value, T const& min, T const& max) +{ + return ::max(min, ::min(value, max)); +} + class FormattingContext { public: virtual ~FormattingContext();