mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 05:27:35 +00:00
LibWeb: Don't place floating boxes before everything else
Instead, just handle them as we go about laying out block-level boxes.
This commit is contained in:
parent
ec89302fbe
commit
66e9dde86f
2 changed files with 3 additions and 15 deletions
|
@ -65,8 +65,6 @@ void BlockFormattingContext::run(Box& box, LayoutMode layout_mode)
|
|||
if (layout_mode == LayoutMode::Default)
|
||||
compute_width(box);
|
||||
|
||||
layout_floating_children(box);
|
||||
|
||||
if (box.children_are_inline()) {
|
||||
layout_inline_children(box, layout_mode);
|
||||
} else {
|
||||
|
@ -458,8 +456,10 @@ void BlockFormattingContext::layout_block_level_children(Box& box, LayoutMode la
|
|||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
if (child_box.is_floating())
|
||||
if (child_box.is_floating()) {
|
||||
layout_floating_child(child_box, box);
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
compute_width(child_box);
|
||||
layout_inside(child_box, layout_mode);
|
||||
|
@ -604,8 +604,6 @@ void BlockFormattingContext::layout_initial_containing_block(LayoutMode layout_m
|
|||
|
||||
icb.set_width(viewport_rect.width());
|
||||
|
||||
layout_floating_children(context_box());
|
||||
|
||||
layout_block_level_children(context_box(), layout_mode);
|
||||
|
||||
ASSERT(!icb.children_are_inline());
|
||||
|
@ -626,15 +624,6 @@ void BlockFormattingContext::layout_initial_containing_block(LayoutMode layout_m
|
|||
});
|
||||
}
|
||||
|
||||
void BlockFormattingContext::layout_floating_children(Box& box)
|
||||
{
|
||||
box.for_each_child_of_type<Box>([&](auto& child_box) {
|
||||
if (child_box.is_floating())
|
||||
layout_floating_child(child_box, box);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
||||
static Gfx::FloatRect rect_in_coordinate_space(const Box& box, const Box& context_box)
|
||||
{
|
||||
Gfx::FloatRect rect { box.effective_offset(), box.size() };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue