mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibWeb/CSS: Allow Selector::absolutized() to return null
It's possible for absolutizing a selector to return an invalid selector (eg, it could cause `:has()` inside `:has()`) so we need to be able to express that.
This commit is contained in:
committed by
Andreas Kling
parent
3a43fa9e35
commit
da31c10ce1
@@ -187,8 +187,10 @@ SelectorList const& CSSStyleRule::absolutized_selectors() const
|
||||
},
|
||||
};
|
||||
SelectorList absolutized_selectors;
|
||||
for (auto const& selector : selectors())
|
||||
absolutized_selectors.append(selector->absolutized(parent_selector));
|
||||
for (auto const& selector : selectors()) {
|
||||
if (auto absolutized = selector->absolutized(parent_selector))
|
||||
absolutized_selectors.append(absolutized.release_nonnull());
|
||||
}
|
||||
m_cached_absolutized_selectors = move(absolutized_selectors);
|
||||
} else {
|
||||
// NOTE: We can't actually replace & with :scope, because & has to have 0 specificity.
|
||||
|
||||
Reference in New Issue
Block a user