diff --git a/Libraries/LibWeb/Parser/CSSParser.cpp b/Libraries/LibWeb/Parser/CSSParser.cpp index f22d69cda1..c044a5e8f5 100644 --- a/Libraries/LibWeb/Parser/CSSParser.cpp +++ b/Libraries/LibWeb/Parser/CSSParser.cpp @@ -510,10 +510,17 @@ public: PARSE_ASSERT(!buffer.is_null()); } + auto value = String::copy(buffer); + + if (type == Selector::SimpleSelector::Type::TagName) { + // Some stylesheets use uppercase tag names, so here's a hack to just lowercase them internally. + value = value.to_lowercase(); + } + Selector::SimpleSelector simple_selector { type, Selector::SimpleSelector::PseudoClass::None, - String::copy(buffer), + value, Selector::SimpleSelector::AttributeMatchType::None, String(), String()