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:
parent
fd32f24753
commit
38d6cc8598
Notes:
sideshowbarker
2024-07-19 05:20:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/38d6cc85986
1 changed files with 8 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue