BackgroundRepeatStyleValue.cpp 870 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
  4. * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
  5. * Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
  6. *
  7. * SPDX-License-Identifier: BSD-2-Clause
  8. */
  9. #include "BackgroundRepeatStyleValue.h"
  10. #include <AK/String.h>
  11. namespace Web::CSS {
  12. BackgroundRepeatStyleValue::BackgroundRepeatStyleValue(Repeat repeat_x, Repeat repeat_y)
  13. : StyleValueWithDefaultOperators(Type::BackgroundRepeat)
  14. , m_properties { .repeat_x = repeat_x, .repeat_y = repeat_y }
  15. {
  16. }
  17. BackgroundRepeatStyleValue::~BackgroundRepeatStyleValue() = default;
  18. ErrorOr<String> BackgroundRepeatStyleValue::to_string() const
  19. {
  20. return String::formatted("{} {}", CSS::to_string(m_properties.repeat_x), CSS::to_string(m_properties.repeat_y));
  21. }
  22. }