mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
LibWeb: Add remaining CSS AttributeMatchTypes
This adds: - ContainsString [att*=val] - StartsWithSegment [att|=val] - StartsWithString [att^=val] - EndsWithString [att$=val] Renamed AttributeMatchType::Contains to ::ContainsWord for clarity.
This commit is contained in:
parent
29d78bba4b
commit
7fefe34797
5 changed files with 38 additions and 10 deletions
|
@ -478,7 +478,7 @@ public:
|
|||
attribute_match_type = CSS::Selector::SimpleSelector::AttributeMatchType::ExactValueMatch;
|
||||
} else if (ch == '~') {
|
||||
consume_one();
|
||||
attribute_match_type = CSS::Selector::SimpleSelector::AttributeMatchType::Contains;
|
||||
attribute_match_type = CSS::Selector::SimpleSelector::AttributeMatchType::ContainsWord;
|
||||
}
|
||||
attribute_name = String::copy(buffer);
|
||||
buffer.clear();
|
||||
|
|
|
@ -189,12 +189,12 @@ Vector<CSS::Selector::ComplexSelector> Parser::parse_selectors(Vector<StyleCompo
|
|||
}
|
||||
|
||||
if (delim_part.token().delim() == "~") {
|
||||
simple_selector.attribute_match_type = CSS::Selector::SimpleSelector::AttributeMatchType::Contains;
|
||||
simple_selector.attribute_match_type = CSS::Selector::SimpleSelector::AttributeMatchType::ContainsWord;
|
||||
attribute_index++;
|
||||
}
|
||||
|
||||
if (delim_part.token().delim() == "|") {
|
||||
simple_selector.attribute_match_type = CSS::Selector::SimpleSelector::AttributeMatchType::StartsWith;
|
||||
simple_selector.attribute_match_type = CSS::Selector::SimpleSelector::AttributeMatchType::StartsWithSegment;
|
||||
attribute_index++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue