LibWeb: Convert uppercase selector tag names to lowercase internally

This is necessary for some older content to work correctly. There's
probably a nicer (and correct-er) way to do this. Deferring to the
new CSS parser.
This commit is contained in:
Andreas Kling 2020-06-28 12:58:04 +02:00
parent fd32f24753
commit 38d6cc8598
Notes: sideshowbarker 2024-07-19 05:20:34 +09:00

View file

@ -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()