ladybird/Libraries/LibHTML/CSS/Selector.h
Andreas Kling 306b9dfb51 LibHTML: Various little improvements to the CSS parser
The parser now kinda recognizes immediate child selectors, !important,
and various other little things.

It's still extremely far from robust and/or correct. :^)
2019-10-06 09:28:58 +02:00

36 lines
684 B
C++

#pragma once
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibHTML/CSS/Specificity.h>
class Selector {
public:
struct Component {
enum class Type {
Invalid,
TagName,
Id,
Class,
};
Type type { Type::Invalid };
enum class Relation {
None,
ImmediateChild,
};
Relation relation { Relation::None };
String value;
};
explicit Selector(Vector<Component>&&);
~Selector();
const Vector<Component>& components() const { return m_components; }
Specificity specificity() const;
private:
Vector<Component> m_components;
};