mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
LibWeb: Parse and match basic "contains" attribute selectors (~=)
This commit is contained in:
parent
a38a5d50ab
commit
65c4e5cacf
4 changed files with 15 additions and 2 deletions
|
@ -91,6 +91,10 @@ bool matches(const Selector::SimpleSelector& component, const Element& element)
|
|||
if (element.attribute(component.attribute_name) != component.attribute_value)
|
||||
return false;
|
||||
break;
|
||||
case Selector::SimpleSelector::AttributeMatchType::Contains:
|
||||
if (!element.attribute(component.attribute_name).split(' ').contains_slow(component.attribute_value))
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue