mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Exit iterate_through_fragments through all recursion levels when the callback says so
This commit is contained in:
parent
fa7839270d
commit
ef8c51c4b1
1 changed files with 6 additions and 2 deletions
|
@ -223,7 +223,9 @@ impl FragmentTreeRoot {
|
||||||
.to_physical(fragment.style.writing_mode, containing_block)
|
.to_physical(fragment.style.writing_mode, containing_block)
|
||||||
.translate(containing_block.origin.to_vector());
|
.translate(containing_block.origin.to_vector());
|
||||||
for child in &fragment.children {
|
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) => {
|
Fragment::Anonymous(fragment) => {
|
||||||
|
@ -232,7 +234,9 @@ impl FragmentTreeRoot {
|
||||||
.to_physical(fragment.mode, containing_block)
|
.to_physical(fragment.mode, containing_block)
|
||||||
.translate(containing_block.origin.to_vector());
|
.translate(containing_block.origin.to_vector());
|
||||||
for child in &fragment.children {
|
for child in &fragment.children {
|
||||||
do_iteration(child, &new_containing_block, process_func);
|
if !do_iteration(child, &new_containing_block, process_func) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue