From ef8c51c4b1444d0dc2623b8ded5a6e0787bfb6ce Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 10 Feb 2020 17:36:19 +0100 Subject: [PATCH] Exit iterate_through_fragments through all recursion levels when the callback says so --- components/layout_2020/flow/root.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/layout_2020/flow/root.rs b/components/layout_2020/flow/root.rs index c8996f1c1b4a..858cd44e0850 100644 --- a/components/layout_2020/flow/root.rs +++ b/components/layout_2020/flow/root.rs @@ -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) => { @@ -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; + } } }, _ => {},