mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +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
|
@ -472,8 +472,13 @@ public:
|
|||
char expected_end_of_attribute_selector = ']';
|
||||
while (peek() != expected_end_of_attribute_selector) {
|
||||
char ch = consume_one();
|
||||
if (ch == '=') {
|
||||
attribute_match_type = Selector::SimpleSelector::AttributeMatchType::ExactValueMatch;
|
||||
if (ch == '=' || (ch == '~' && peek() == '=')) {
|
||||
if (ch == '=') {
|
||||
attribute_match_type = Selector::SimpleSelector::AttributeMatchType::ExactValueMatch;
|
||||
} else if (ch == '~') {
|
||||
consume_one();
|
||||
attribute_match_type = Selector::SimpleSelector::AttributeMatchType::Contains;
|
||||
}
|
||||
attribute_name = String::copy(buffer);
|
||||
buffer.clear();
|
||||
in_value = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue