From 7fefe34797a49be9a198093a68b6a1f40d6be733 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 1 Jul 2021 15:31:44 +0100 Subject: 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. --- .../LibWeb/CSS/Parser/DeprecatedCSSParser.cpp | 2 +- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 4 ++-- Userland/Libraries/LibWeb/CSS/Selector.h | 7 +++++-- Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp | 18 +++++++++++++++++- Userland/Libraries/LibWeb/Dump.cpp | 17 +++++++++++++---- 5 files changed, 38 insertions(+), 10 deletions(-) (limited to 'Userland/Libraries/LibWeb') diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp index 6de38c9d98..18b6bfc8f5 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp @@ -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(); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index fa945f30a6..aaa3696f7c 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -189,12 +189,12 @@ Vector Parser::parse_selectors(Vector