mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 15:49:15 +00:00
LibWeb/CSS: Rename background-repeat related symbols to align with spec
These will be used for the mask-repeat property as well in an upcoming commit, hence the more generic names. Also, this more closely matches the names used in the spec.
This commit is contained in:
parent
667f195d1e
commit
add3a095d8
Notes:
github-actions[bot]
2025-08-06 22:10:59 +00:00
Author: https://github.com/InvalidUsernameException
Commit: add3a095d8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5511
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/Calme1709
17 changed files with 151 additions and 150 deletions
36
Libraries/LibWeb/CSS/StyleValues/RepeatStyleStyleValue.cpp
Normal file
36
Libraries/LibWeb/CSS/StyleValues/RepeatStyleStyleValue.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "RepeatStyleStyleValue.h"
|
||||
#include <AK/String.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
RepeatStyleStyleValue::RepeatStyleStyleValue(Repetition repeat_x, Repetition repeat_y)
|
||||
: StyleValueWithDefaultOperators(Type::RepeatStyle)
|
||||
, m_properties { .repeat_x = repeat_x, .repeat_y = repeat_y }
|
||||
{
|
||||
}
|
||||
|
||||
RepeatStyleStyleValue::~RepeatStyleStyleValue() = default;
|
||||
|
||||
String RepeatStyleStyleValue::to_string(SerializationMode) const
|
||||
{
|
||||
if (m_properties.repeat_x == m_properties.repeat_y)
|
||||
return MUST(String::from_utf8(CSS::to_string(m_properties.repeat_x)));
|
||||
|
||||
if (m_properties.repeat_x == Repetition::Repeat && m_properties.repeat_y == Repetition::NoRepeat)
|
||||
return "repeat-x"_string;
|
||||
if (m_properties.repeat_x == Repetition::NoRepeat && m_properties.repeat_y == Repetition::Repeat)
|
||||
return "repeat-y"_string;
|
||||
|
||||
return MUST(String::formatted("{} {}", CSS::to_string(m_properties.repeat_x), CSS::to_string(m_properties.repeat_y)));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue