1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Parse :host() selector

We were already parsing non-function-syntax :host, so let's also do
the :host(...) variant. Note that we don't have matching for these yet.

This fixes many issues on sites generated by Wix, as they often have
selector lists that include some :host() selector, and we'd reject the
entire rule after failing to parse it.
This commit is contained in:
Andreas Kling 2023-08-05 11:51:31 +02:00
parent ac2d9d9273
commit 64c06c345e
4 changed files with 35 additions and 0 deletions

View file

@ -574,6 +574,7 @@ void dump_selector(StringBuilder& builder, CSS::Selector const& selector)
builder.join(',', pseudo_class.languages);
builder.append(')');
} else if (pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::Not
|| pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::Host
|| pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::Is
|| pseudo_class.type == CSS::Selector::SimpleSelector::PseudoClass::Type::Where) {
builder.append("(["sv);