BorderStyleValue.cpp 1.0 KB

123456789101112131415161718192021222324252627282930
  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 "BorderStyleValue.h"
  10. namespace Web::CSS {
  11. BorderStyleValue::BorderStyleValue(
  12. ValueComparingNonnullRefPtr<StyleValue> border_width,
  13. ValueComparingNonnullRefPtr<StyleValue> border_style,
  14. ValueComparingNonnullRefPtr<StyleValue> border_color)
  15. : StyleValueWithDefaultOperators(Type::Border)
  16. , m_properties { .border_width = move(border_width), .border_style = move(border_style), .border_color = move(border_color) }
  17. {
  18. }
  19. BorderStyleValue::~BorderStyleValue() = default;
  20. ErrorOr<String> BorderStyleValue::to_string() const
  21. {
  22. return String::formatted("{} {} {}", TRY(m_properties.border_width->to_string()), TRY(m_properties.border_style->to_string()), TRY(m_properties.border_color->to_string()));
  23. }
  24. }