mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +00:00
LibWeb: Store BorderRadiusStyleValue
sub-values directly
Storing these within LengthPercentage is unnecessary
This commit is contained in:
parent
2ebf446cbf
commit
25192d3c20
Notes:
github-actions[bot]
2025-10-07 09:51:15 +00:00
Author: https://github.com/Calme1709
Commit: 25192d3c20
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6375
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 47 additions and 61 deletions
|
@ -14,14 +14,14 @@ namespace Web::CSS {
|
|||
String BorderRadiusStyleValue::to_string(SerializationMode mode) const
|
||||
{
|
||||
if (m_properties.horizontal_radius == m_properties.vertical_radius)
|
||||
return m_properties.horizontal_radius.to_string(mode);
|
||||
return MUST(String::formatted("{} {}", m_properties.horizontal_radius.to_string(mode), m_properties.vertical_radius.to_string(mode)));
|
||||
return m_properties.horizontal_radius->to_string(mode);
|
||||
return MUST(String::formatted("{} {}", m_properties.horizontal_radius->to_string(mode), m_properties.vertical_radius->to_string(mode)));
|
||||
}
|
||||
|
||||
ValueComparingNonnullRefPtr<StyleValue const> BorderRadiusStyleValue::absolutized(ComputationContext const& computation_context) const
|
||||
{
|
||||
auto absolutized_horizontal_radius = m_properties.horizontal_radius.absolutized(computation_context);
|
||||
auto absolutized_vertical_radius = m_properties.vertical_radius.absolutized(computation_context);
|
||||
auto absolutized_horizontal_radius = m_properties.horizontal_radius->absolutized(computation_context);
|
||||
auto absolutized_vertical_radius = m_properties.vertical_radius->absolutized(computation_context);
|
||||
|
||||
if (absolutized_vertical_radius == m_properties.vertical_radius && absolutized_horizontal_radius == m_properties.horizontal_radius)
|
||||
return *this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue