TransformationStyleValue.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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 "TransformationStyleValue.h"
  10. #include <AK/StringBuilder.h>
  11. namespace Web::CSS {
  12. String TransformationStyleValue::to_string() const
  13. {
  14. StringBuilder builder;
  15. builder.append(CSS::to_string(m_properties.transform_function));
  16. builder.append('(');
  17. for (size_t i = 0; i < m_properties.values.size(); ++i) {
  18. builder.append(m_properties.values[i]->to_string());
  19. if (i != m_properties.values.size() - 1)
  20. builder.append(", "sv);
  21. }
  22. builder.append(')');
  23. return MUST(builder.to_string());
  24. }
  25. bool TransformationStyleValue::Properties::operator==(Properties const& other) const
  26. {
  27. return transform_function == other.transform_function && values.span() == other.values.span();
  28. }
  29. }