mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/CSS: Serialize background-repeat correctly
This gets us 4 WPT subtest passes.
This commit is contained in:
parent
2fc164c0b6
commit
5bcd9abc42
Notes:
github-actions[bot]
2024-11-30 10:03:31 +00:00
Author: https://github.com/AtkinsSJ
Commit: 5bcd9abc42
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2638
6 changed files with 21 additions and 13 deletions
|
@ -22,6 +22,14 @@ BackgroundRepeatStyleValue::~BackgroundRepeatStyleValue() = default;
|
|||
|
||||
String BackgroundRepeatStyleValue::to_string() 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 == Repeat::Repeat && m_properties.repeat_y == Repeat::NoRepeat)
|
||||
return "repeat-x"_string;
|
||||
if (m_properties.repeat_x == Repeat::NoRepeat && m_properties.repeat_y == Repeat::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