LibWeb: Parse corner-*-shape physical longhands

This commit is contained in:
Callum Law 2025-10-08 22:43:27 +13:00 committed by Sam Atkins
commit 814efa9809
Notes: github-actions[bot] 2025-10-09 09:24:55 +00:00
19 changed files with 415 additions and 224 deletions

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2025, Callum Law <callumlaw1709@outlook.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "SuperellipseStyleValue.h"
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
namespace Web::CSS {
String SuperellipseStyleValue::to_string(SerializationMode mode) const
{
auto stringified_parameter = [&] {
if (!m_parameter->is_number())
return m_parameter->to_string(mode);
auto number = m_parameter->as_number().number();
if (number == AK::Infinity<double>)
return "infinity"_string;
if (number == -AK::Infinity<double>)
return "-infinity"_string;
return m_parameter->to_string(mode);
}();
return MUST(String::formatted("superellipse({})", stringified_parameter));
}
}