EdgeStyleValue.cpp 672 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2023, MacDue <macdue@dueutil.tech>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "EdgeStyleValue.h"
  7. namespace Web::CSS {
  8. String EdgeStyleValue::to_string() const
  9. {
  10. auto to_string = [](PositionEdge edge) {
  11. switch (edge) {
  12. case PositionEdge::Left:
  13. return "left";
  14. case PositionEdge::Right:
  15. return "right";
  16. case PositionEdge::Top:
  17. return "top";
  18. case PositionEdge::Bottom:
  19. return "bottom";
  20. }
  21. VERIFY_NOT_REACHED();
  22. };
  23. return MUST(String::formatted("{} {}", to_string(m_properties.edge), m_properties.offset.to_string()));
  24. }
  25. }