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

LibWeb: Rename "for_each_in_subtree(_of_type)" to "for_each_in_inclusive_subtree(_of_type)"

This is because it includes the initial node that the function was
called on, which makes it "inclusive" as according to the spec.

This is important as there are non-inclusive variants, particularly
used in the node mutation algorithms.
This commit is contained in:
Luke 2021-04-06 18:38:10 +01:00 committed by Andreas Kling
parent f482628fe5
commit ca71ac484b
12 changed files with 29 additions and 29 deletions

View file

@ -37,7 +37,7 @@ StyleInvalidator::StyleInvalidator(DOM::Document& document)
if (!m_document.should_invalidate_styles_on_attribute_changes())
return;
auto& style_resolver = m_document.style_resolver();
m_document.for_each_in_subtree_of_type<DOM::Element>([&](auto& element) {
m_document.for_each_in_inclusive_subtree_of_type<DOM::Element>([&](auto& element) {
m_elements_and_matching_rules_before.set(&element, style_resolver.collect_matching_rules(element));
return IterationDecision::Continue;
});
@ -48,7 +48,7 @@ StyleInvalidator::~StyleInvalidator()
if (!m_document.should_invalidate_styles_on_attribute_changes())
return;
auto& style_resolver = m_document.style_resolver();
m_document.for_each_in_subtree_of_type<DOM::Element>([&](auto& element) {
m_document.for_each_in_inclusive_subtree_of_type<DOM::Element>([&](auto& element) {
auto maybe_matching_rules_before = m_elements_and_matching_rules_before.get(&element);
if (!maybe_matching_rules_before.has_value()) {
element.set_needs_style_update(true);