diff --git a/components/layout/block.rs b/components/layout/block.rs index fedca650919..a75a2e48274 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -906,7 +906,7 @@ impl BlockFlow { clear::right => floats.clearance(ClearRight), clear::both => floats.clearance(ClearBoth), }; - cur_b = cur_b + clearance; + translate_including_floats(&mut cur_b, clearance, &mut floats); // At this point, `cur_b` is at the border edge of the child. flow::mut_base(kid).position.start.b = cur_b; diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 775b6fcfe1c..691ef8b4d12 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -138,3 +138,4 @@ flaky_gpu,flaky_linux == acid2_noscroll.html acid2_ref_broken.html == percentage_height_float_a.html percentage_height_float_ref.html == img_block_maxwidth_a.html img_block_maxwidth_ref.html == img_block_maxwidth_b.html img_block_maxwidth_ref.html +== float_clearance_a.html float_clearance_ref.html diff --git a/tests/ref/float_clearance_a.html b/tests/ref/float_clearance_a.html new file mode 100644 index 00000000000..a24e90e14ce --- /dev/null +++ b/tests/ref/float_clearance_a.html @@ -0,0 +1,13 @@ + + +
+ + +