LibHTML: Implement some attribute selector support

This patch adds a[foo] and a[foo=bar] attribute selectors.

Note that an attribute selector is an optional part of a selector
component, and not a component on its own.
This commit is contained in:
Andreas Kling 2019-11-21 20:07:43 +01:00
commit 8946e50986
Notes: sideshowbarker 2024-07-19 11:07:23 +09:00
6 changed files with 115 additions and 8 deletions

View file

@ -33,6 +33,16 @@ public:
Relation relation { Relation::None };
String value;
enum class AttributeMatchType {
None,
HasAttribute,
ExactValueMatch,
};
AttributeMatchType attribute_match_type { AttributeMatchType::None };
String attribute_name;
String attribute_value;
};
explicit Selector(Vector<Component>&&);