StyleBlockRule.h 892 B

123456789101112131415161718192021222324252627282930313233343536
  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/Vector.h>
  10. #include <LibWeb/CSS/Parser/StyleComponentValueRule.h>
  11. #include <LibWeb/CSS/Parser/Token.h>
  12. namespace Web::CSS {
  13. class StyleBlockRule : public RefCounted<StyleBlockRule> {
  14. friend class Parser;
  15. public:
  16. StyleBlockRule();
  17. ~StyleBlockRule();
  18. bool is_curly() const { return m_token.is(Token::Type::OpenCurly); }
  19. bool is_paren() const { return m_token.is(Token::Type::OpenParen); }
  20. bool is_square() const { return m_token.is(Token::Type::OpenSquare); }
  21. Vector<StyleComponentValueRule> const& values() const { return m_values; }
  22. String to_string() const;
  23. private:
  24. Token m_token;
  25. Vector<StyleComponentValueRule> m_values;
  26. };
  27. }