mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Use TraversalDecision
for multi level Node traversal methods
This adds the `SkipChildrenAndContinue` option, where traversal continues but child nodes are not included.
This commit is contained in:
parent
c57d395a48
commit
398bf10b92
Notes:
sideshowbarker
2024-07-17 08:59:18 +09:00
Author: https://github.com/tcl3
Commit: 398bf10b92
Pull-request: https://github.com/SerenityOS/serenity/pull/24207
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/shannonbooth ✅
33 changed files with 229 additions and 215 deletions
|
@ -410,9 +410,9 @@ CSSPixels FormattingContext::compute_table_box_width_inside_table_wrapper(Box co
|
|||
box.for_each_in_subtree_of_type<Box>([&](Box const& child_box) {
|
||||
if (child_box.display().is_table_inside()) {
|
||||
table_box = child_box;
|
||||
return IterationDecision::Break;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
VERIFY(table_box.has_value());
|
||||
|
||||
|
@ -464,9 +464,9 @@ CSSPixels FormattingContext::compute_table_box_height_inside_table_wrapper(Box c
|
|||
box.for_each_in_subtree_of_type<Box>([&](Box const& child_box) {
|
||||
if (child_box.display().is_table_inside()) {
|
||||
table_box = child_box;
|
||||
return IterationDecision::Break;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
VERIFY(table_box.has_value());
|
||||
|
||||
|
@ -1808,9 +1808,9 @@ bool FormattingContext::can_skip_is_anonymous_text_run(Box& box)
|
|||
box.for_each_in_subtree([&](auto const& node) {
|
||||
if (!is<TextNode>(node) || !static_cast<TextNode const&>(node).dom_node().data().bytes_as_string_view().is_whitespace()) {
|
||||
contains_only_white_space = false;
|
||||
return IterationDecision::Break;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
if (contains_only_white_space)
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue