StyleFunctionRule.h 888 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2020-2021, the SerenityOS developers.
  3. * Copyright (c) 2021, Sam Atkins <atkinssj@gmail.com>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/RefCounted.h>
  9. #include <AK/String.h>
  10. #include <AK/Vector.h>
  11. namespace Web::CSS {
  12. class StyleComponentValueRule;
  13. class StyleFunctionRule : public RefCounted<StyleFunctionRule> {
  14. friend class Parser;
  15. public:
  16. StyleFunctionRule(String name);
  17. ~StyleFunctionRule();
  18. String const& name() const { return m_name; }
  19. Vector<StyleComponentValueRule> const& values() const { return m_values; }
  20. // FIXME: This method is a temporary hack while much of the parser still expects a string, rather than tokens.
  21. String values_as_string() const
  22. {
  23. return "";
  24. }
  25. String to_string() const;
  26. private:
  27. String m_name;
  28. Vector<StyleComponentValueRule> m_values;
  29. };
  30. }