@@ -515,22 +515,22 @@ void BlockFormattingContext::place_block_level_non_replaced_element_in_normal_fl
515
515
}
516
516
}
517
517
518
- auto clear_floating_boxes = [&](auto & floating_boxes ) {
519
- if (!floating_boxes .is_empty ()) {
518
+ auto clear_floating_boxes = [&](auto & float_side ) {
519
+ if (!float_side. boxes .is_empty ()) {
520
520
float clearance_y = 0 ;
521
- for (auto * floating_box : floating_boxes ) {
522
- clearance_y = max (clearance_y, floating_box-> effective_offset ().y () + floating_box-> border_box_height ());
521
+ for (auto & floating_box : float_side. boxes ) {
522
+ clearance_y = max (clearance_y, floating_box. effective_offset ().y () + floating_box. border_box_height ());
523
523
}
524
524
y = max (y, clearance_y);
525
- floating_boxes .clear ();
525
+ float_side. boxes .clear ();
526
526
}
527
527
};
528
528
529
529
// Flex-items don't float and also don't clear.
530
530
if ((computed_values.clear () == CSS::Clear::Left || computed_values.clear () == CSS::Clear::Both) && !child_box.is_flex_item ())
531
- clear_floating_boxes (m_left_floating_boxes );
531
+ clear_floating_boxes (m_left_floats );
532
532
if ((computed_values.clear () == CSS::Clear::Right || computed_values.clear () == CSS::Clear::Both) && !child_box.is_flex_item ())
533
- clear_floating_boxes (m_right_floating_boxes );
533
+ clear_floating_boxes (m_right_floats );
534
534
535
535
child_box.set_offset (x, y);
536
536
}
@@ -601,8 +601,8 @@ void BlockFormattingContext::layout_floating_child(Box& box, BlockContainer cons
601
601
602
602
// Next, float to the left and/or right
603
603
if (box.computed_values ().float_ () == CSS::Float::Left) {
604
- if (!m_left_floating_boxes .is_empty ()) {
605
- auto & previous_floating_box = *m_left_floating_boxes .last ();
604
+ if (!m_left_floats. boxes .is_empty ()) {
605
+ auto & previous_floating_box = m_left_floats. boxes .last ();
606
606
auto previous_rect = rect_in_coordinate_space (previous_floating_box, root ());
607
607
if (previous_rect.contains_vertically (y_in_root)) {
608
608
// This box touches another already floating box. Stack to the right.
@@ -611,16 +611,16 @@ void BlockFormattingContext::layout_floating_child(Box& box, BlockContainer cons
611
611
// This box does not touch another floating box, go all the way to the left.
612
612
x = box.box_model ().margin_box ().left ;
613
613
// Also, forget all previous left-floating boxes while we're here since they're no longer relevant.
614
- m_left_floating_boxes .clear ();
614
+ m_left_floats. boxes .clear ();
615
615
}
616
616
} else {
617
617
// This is the first left-floating box. Go all the way to the left.
618
618
x = box.box_model ().margin_box ().left ;
619
619
}
620
- m_left_floating_boxes. append (& box);
620
+ m_left_floats. boxes . append (box);
621
621
} else if (box.computed_values ().float_ () == CSS::Float::Right) {
622
- if (!m_right_floating_boxes .is_empty ()) {
623
- auto & previous_floating_box = *m_right_floating_boxes .last ();
622
+ if (!m_right_floats. boxes .is_empty ()) {
623
+ auto & previous_floating_box = m_right_floats. boxes .last ();
624
624
auto previous_rect = rect_in_coordinate_space (previous_floating_box, root ());
625
625
if (previous_rect.contains_vertically (y_in_root)) {
626
626
// This box touches another already floating box. Stack to the left.
@@ -629,13 +629,13 @@ void BlockFormattingContext::layout_floating_child(Box& box, BlockContainer cons
629
629
// This box does not touch another floating box, go all the way to the right.
630
630
x = containing_block.width () - box.box_model ().margin_box ().right - box.width ();
631
631
// Also, forget all previous right-floating boxes while we're here since they're no longer relevant.
632
- m_right_floating_boxes .clear ();
632
+ m_right_floats. boxes .clear ();
633
633
}
634
634
} else {
635
635
// This is the first right-floating box. Go all the way to the right.
636
636
x = containing_block.width () - box.box_model ().margin_box ().right - box.width ();
637
637
}
638
- m_right_floating_boxes. append (& box);
638
+ m_right_floats. boxes . append (box);
639
639
}
640
640
641
641
box.set_offset (x, box.effective_offset ().y ());
0 commit comments