Skip to content

Commit 332c471

Browse files
committed
LibWeb: Simplify LayoutBlock::layout_block_children() a little bit
No need to worry about inline children if children are not inline(!)
1 parent 62615df commit 332c471

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Libraries/LibWeb/Layout/LayoutBlock.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,10 @@ void LayoutBlock::layout_block_children(LayoutMode layout_mode)
143143
{
144144
ASSERT(!children_are_inline());
145145
float content_height = 0;
146-
for_each_child([&](auto& child) {
147-
// FIXME: What should we do here? Something like a <table> might have a bunch of useless text children..
148-
if (child.is_inline())
149-
return;
150-
auto& child_block = static_cast<LayoutBlock&>(child);
151-
child_block.layout(layout_mode);
152-
153-
if (!child_block.is_absolutely_positioned())
154-
content_height = max(content_height, child_block.effective_offset().y() + child_block.height() + child_block.box_model().margin_box(*this).bottom);
146+
for_each_child_of_type<LayoutBlock>([&](auto& child) {
147+
child.layout(layout_mode);
148+
if (!child.is_absolutely_positioned())
149+
content_height = max(content_height, child.effective_offset().y() + child.height() + child.box_model().margin_box(*this).bottom);
155150
});
156151
if (layout_mode != LayoutMode::Default) {
157152
float max_width = 0;

0 commit comments

Comments
 (0)