Skip to content

Commit

Permalink
Exit iterate_through_fragments through all recursion levels when the …
Browse files Browse the repository at this point in the history
…callback says so
  • Loading branch information
SimonSapin committed Feb 11, 2020
1 parent fa78392 commit ef8c51c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/layout_2020/flow/root.rs
Expand Up @@ -223,7 +223,9 @@ impl FragmentTreeRoot {
.to_physical(fragment.style.writing_mode, containing_block)
.translate(containing_block.origin.to_vector());
for child in &fragment.children {
do_iteration(child, &new_containing_block, process_func);
if !do_iteration(child, &new_containing_block, process_func) {
return false;
}
}
},
Fragment::Anonymous(fragment) => {
Expand All @@ -232,7 +234,9 @@ impl FragmentTreeRoot {
.to_physical(fragment.mode, containing_block)
.translate(containing_block.origin.to_vector());
for child in &fragment.children {
do_iteration(child, &new_containing_block, process_func);
if !do_iteration(child, &new_containing_block, process_func) {
return false;
}
}
},
_ => {},
Expand Down

0 comments on commit ef8c51c

Please sign in to comment.