1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +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

@ -120,7 +120,7 @@ Label* Label::label_for_control_node(LabelableNode& control)
if (id.is_empty())
return label;
control.document().layout_node()->for_each_in_subtree_of_type<Label>([&](auto& node) {
control.document().layout_node()->for_each_in_inclusive_subtree_of_type<Label>([&](auto& node) {
if (node.dom_node().for_() == id) {
label = &node;
return IterationDecision::Break;
@ -144,7 +144,7 @@ LabelableNode* Label::control_node()
if (for_.is_empty())
return control;
document().layout_node()->for_each_in_subtree_of_type<LabelableNode>([&](auto& node) {
document().layout_node()->for_each_in_inclusive_subtree_of_type<LabelableNode>([&](auto& node) {
if (node.dom_node().attribute(HTML::AttributeNames::id) == for_) {
control = &node;
return IterationDecision::Break;