RevertStyleValue.h 797 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/CSS/StyleValue.h>
  8. namespace Web::CSS {
  9. class RevertStyleValue final : public StyleValueWithDefaultOperators<RevertStyleValue> {
  10. public:
  11. static ValueComparingNonnullRefPtr<RevertStyleValue> the()
  12. {
  13. static ValueComparingNonnullRefPtr<RevertStyleValue> instance = adopt_ref(*new (nothrow) RevertStyleValue);
  14. return instance;
  15. }
  16. virtual ~RevertStyleValue() override = default;
  17. String to_string() const override { return "revert"_string; }
  18. bool properties_equal(RevertStyleValue const&) const { return true; }
  19. private:
  20. RevertStyleValue()
  21. : StyleValueWithDefaultOperators(Type::Revert)
  22. {
  23. }
  24. };
  25. }