Selector.h 550 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <AK/AKString.h>
  3. #include <AK/Vector.h>
  4. #include <LibHTML/CSS/Specificity.h>
  5. class Selector {
  6. public:
  7. struct Component {
  8. enum class Type {
  9. Invalid,
  10. TagName,
  11. Id,
  12. Class
  13. };
  14. Type type { Type::Invalid };
  15. String value;
  16. };
  17. explicit Selector(Vector<Component>&&);
  18. ~Selector();
  19. const Vector<Component>& components() const { return m_components; }
  20. Specificity specificity() const;
  21. private:
  22. Vector<Component> m_components;
  23. };