mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 18:55:08 +00:00
LibHTML: Add Selector::specificity(), which returns a Specificity object.
This commit is contained in:
parent
b729b5fc64
commit
9a7dc06567
3 changed files with 68 additions and 1 deletions
|
@ -2,11 +2,17 @@
|
|||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibHTML/CSS/Specificity.h>
|
||||
|
||||
class Selector {
|
||||
public:
|
||||
struct Component {
|
||||
enum class Type { Invalid, TagName, Id, Class };
|
||||
enum class Type {
|
||||
Invalid,
|
||||
TagName,
|
||||
Id,
|
||||
Class
|
||||
};
|
||||
Type type { Type::Invalid };
|
||||
String value;
|
||||
};
|
||||
|
@ -16,6 +22,8 @@ public:
|
|||
|
||||
const Vector<Component>& components() const { return m_components; }
|
||||
|
||||
Specificity specificity() const;
|
||||
|
||||
private:
|
||||
Vector<Component> m_components;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue