mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Build invalidation sets from ::slotted() simple selectors
build_invalidation_sets_for_simple_selector ignored ::slotted() pseudo-element selectors entirely. As a result, the invalidation plans built for a shadow scope didn't list class, attribute, or pseudo-class properties referenced inside ::slotted(), so changing those properties on a slottable couldn't enqueue an invalidation plan for the rule. Recurse into ::slotted()'s compound argument and feed each simple selector through the same invalidation-set builder.
This commit is contained in:
committed by
Andreas Kling
parent
7d6f77bdf3
commit
09c0caf986
Notes:
github-actions[bot]
2026-04-26 08:43:02 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/09c0caf9862 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/9095
@@ -406,6 +406,18 @@ void build_invalidation_sets_for_simple_selector(Selector::SimpleSelector const&
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Selector::SimpleSelector::Type::PseudoElement: {
|
||||
// Pseudo-elements like ::slotted(.x) and ::part(...) carry a compound selector argument whose simple
|
||||
// selectors decide which property changes should trigger invalidation against this rule.
|
||||
auto const& pseudo_element = selector.pseudo_element();
|
||||
if (pseudo_element.type() == PseudoElement::Slotted) {
|
||||
for (auto const& compound_selector : pseudo_element.compound_selector().compound_selectors()) {
|
||||
for (auto const& nested_simple : compound_selector.simple_selectors)
|
||||
build_invalidation_sets_for_simple_selector(nested_simple, invalidation_set, exclude_properties_nested_in_not_pseudo_class, style_invalidation_data, inside_nth_child_selector);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user