AngleStyleValue.cpp 804 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
  3. * Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
  4. * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
  5. * Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
  6. *
  7. * SPDX-License-Identifier: BSD-2-Clause
  8. */
  9. #include "AngleStyleValue.h"
  10. namespace Web::CSS {
  11. AngleStyleValue::AngleStyleValue(Angle angle)
  12. : CSSUnitValue(Type::Angle)
  13. , m_angle(move(angle))
  14. {
  15. }
  16. AngleStyleValue::~AngleStyleValue() = default;
  17. String AngleStyleValue::to_string() const
  18. {
  19. return m_angle.to_string();
  20. }
  21. bool AngleStyleValue::equals(CSSStyleValue const& other) const
  22. {
  23. if (type() != other.type())
  24. return false;
  25. auto const& other_angle = other.as_angle();
  26. return m_angle == other_angle.m_angle;
  27. }
  28. }