mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17: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)
|
if (layout_mode == LayoutMode::Default)
|
||||||
compute_width(box);
|
compute_width(box);
|
||||||
|
|
||||||
layout_floating_children(box);
|
|
||||||
|
|
||||||
if (box.children_are_inline()) {
|
if (box.children_are_inline()) {
|
||||||
layout_inline_children(box, layout_mode);
|
layout_inline_children(box, layout_mode);
|
||||||
} else {
|
} else {
|
||||||
|
@ -458,8 +456,10 @@ void BlockFormattingContext::layout_block_level_children(Box& box, LayoutMode la
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child_box.is_floating())
|
if (child_box.is_floating()) {
|
||||||
|
layout_floating_child(child_box, box);
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
|
}
|
||||||
|
|
||||||
compute_width(child_box);
|
compute_width(child_box);
|
||||||
layout_inside(child_box, layout_mode);
|
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());
|
icb.set_width(viewport_rect.width());
|
||||||
|
|
||||||
layout_floating_children(context_box());
|
|
||||||
|
|
||||||
layout_block_level_children(context_box(), layout_mode);
|
layout_block_level_children(context_box(), layout_mode);
|
||||||
|
|
||||||
ASSERT(!icb.children_are_inline());
|
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)
|
static Gfx::FloatRect rect_in_coordinate_space(const Box& box, const Box& context_box)
|
||||||
{
|
{
|
||||||
Gfx::FloatRect rect { box.effective_offset(), box.size() };
|
Gfx::FloatRect rect { box.effective_offset(), box.size() };
|
||||||
|
|
|
@ -61,7 +61,6 @@ private:
|
||||||
|
|
||||||
void layout_block_level_children(Box&, LayoutMode);
|
void layout_block_level_children(Box&, LayoutMode);
|
||||||
void layout_inline_children(Box&, LayoutMode);
|
void layout_inline_children(Box&, LayoutMode);
|
||||||
void layout_floating_children(Box&);
|
|
||||||
|
|
||||||
void place_block_level_replaced_element_in_normal_flow(Box& child, Box& container);
|
void place_block_level_replaced_element_in_normal_flow(Box& child, Box& container);
|
||||||
void place_block_level_non_replaced_element_in_normal_flow(Box& child, Box& container);
|
void place_block_level_non_replaced_element_in_normal_flow(Box& child, Box& container);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue