mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb/CSS: Correct parsing of @supports selector()
A couple of fixes here: - Parse a `<complex-selector>` instead of a `<selector-list>` - Don't match if any unknown `::-webkit-*` pseudo-elements are found
This commit is contained in:
parent
b6fb4baeb7
commit
db597843d6
Notes:
github-actions[bot]
2025-03-17 10:01:11 +00:00
Author: https://github.com/AtkinsSJ
Commit: db597843d6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3941
8 changed files with 100 additions and 4 deletions
|
@ -646,6 +646,24 @@ NonnullRefPtr<Selector> Selector::relative_to(SimpleSelector const& parent) cons
|
|||
return Selector::create(move(copied_compound_selectors));
|
||||
}
|
||||
|
||||
bool Selector::contains_unknown_webkit_pseudo_element() const
|
||||
{
|
||||
for (auto const& compound_selector : m_compound_selectors) {
|
||||
for (auto const& simple_selector : compound_selector.simple_selectors) {
|
||||
if (simple_selector.type == SimpleSelector::Type::PseudoClass) {
|
||||
for (auto const& child_selector : simple_selector.pseudo_class().argument_selector_list) {
|
||||
if (child_selector->contains_unknown_webkit_pseudo_element()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (simple_selector.type == SimpleSelector::Type::PseudoElement && simple_selector.pseudo_element().type() == PseudoElement::Type::UnknownWebKit)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
RefPtr<Selector> Selector::absolutized(Selector::SimpleSelector const& selector_for_nesting) const
|
||||
{
|
||||
if (!contains_the_nesting_selector())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue