PlaceSelfStyleValue.cpp 530 B

1234567891011121314151617181920
  1. /*
  2. * Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "PlaceSelfStyleValue.h"
  7. namespace Web::CSS {
  8. ErrorOr<String> PlaceSelfStyleValue::to_string() const
  9. {
  10. auto align_self = TRY(m_properties.align_self->to_string());
  11. auto justify_self = TRY(m_properties.justify_self->to_string());
  12. if (align_self == justify_self)
  13. return String::formatted("{}", align_self);
  14. return String::formatted("{} {}", align_self, justify_self);
  15. }
  16. }