DisplayStyleValue.h 880 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2023, Emil Militzer <emil.militzer@posteo.de>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/CSS/CSSStyleValue.h>
  8. #include <LibWeb/CSS/Display.h>
  9. namespace Web::CSS {
  10. class DisplayStyleValue : public StyleValueWithDefaultOperators<DisplayStyleValue> {
  11. public:
  12. static ValueComparingNonnullRefPtr<DisplayStyleValue> create(Display const&);
  13. virtual ~DisplayStyleValue() override = default;
  14. virtual String to_string() const override { return m_display.to_string(); }
  15. Display display() const { return m_display; }
  16. bool properties_equal(DisplayStyleValue const& other) const { return m_display == other.m_display; }
  17. private:
  18. explicit DisplayStyleValue(Display const& display)
  19. : StyleValueWithDefaultOperators(Type::Display)
  20. , m_display(display)
  21. {
  22. }
  23. Display m_display;
  24. };
  25. }