mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
LibWeb: Parse corner-*-shape
physical longhands
This commit is contained in:
parent
0bf6014001
commit
814efa9809
Notes:
github-actions[bot]
2025-10-09 09:24:55 +00:00
Author: https://github.com/Calme1709
Commit: 814efa9809
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6425
Reviewed-by: https://github.com/AtkinsSJ ✅
19 changed files with 415 additions and 224 deletions
32
Libraries/LibWeb/CSS/StyleValues/SuperellipseStyleValue.cpp
Normal file
32
Libraries/LibWeb/CSS/StyleValues/SuperellipseStyleValue.cpp
Normal 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));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue