mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibWeb: Add method to check if element affected by invalidation set
...by replacing existing method to check if an element is affected by invalidation property. It turned out there is no need to check if an element is affected only by some specific property, so it's more convenient to have a method that accepts the whole set.
This commit is contained in:
parent
74dc335b28
commit
e33037ad52
Notes:
github-actions[bot]
2025-01-29 08:31:28 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: e33037ad52
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3391
3 changed files with 53 additions and 53 deletions
|
@ -486,18 +486,6 @@ void Node::invalidate_style(StyleInvalidationReason reason, Vector<CSS::Invalida
|
|||
set_needs_style_update(true);
|
||||
}
|
||||
|
||||
auto element_has_properties_from_invalidation_set = [&](Element& element) {
|
||||
bool result = false;
|
||||
invalidation_set.for_each_property([&](auto const& property) {
|
||||
if (element.affected_by_invalidation_property(property)) {
|
||||
result = true;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
auto invalidate_entire_subtree = [&](Node& subtree_root) {
|
||||
subtree_root.for_each_shadow_including_inclusive_descendant([&](Node& node) {
|
||||
if (!node.is_element())
|
||||
|
@ -506,7 +494,7 @@ void Node::invalidate_style(StyleInvalidationReason reason, Vector<CSS::Invalida
|
|||
bool needs_style_recalculation = false;
|
||||
if (invalidation_set.needs_invalidate_whole_subtree()) {
|
||||
needs_style_recalculation = true;
|
||||
} else if (element_has_properties_from_invalidation_set(element)) {
|
||||
} else if (element.includes_properties_from_invalidation_set(invalidation_set)) {
|
||||
needs_style_recalculation = true;
|
||||
} else if (options.invalidate_elements_that_use_css_custom_properties && element.style_uses_css_custom_properties()) {
|
||||
needs_style_recalculation = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue