diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-14 16:47:33 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-14 16:48:17 +0200 |
commit | 332c4713010c45729236141e353c8d623f28c43f (patch) | |
tree | 429f428363a6c372a5a730e9696887c3fde5cc02 | |
parent | 62615dfc31f22d311f33ce7061436246ce5deca3 (diff) | |
download | serenity-332c4713010c45729236141e353c8d623f28c43f.zip |
LibWeb: Simplify LayoutBlock::layout_block_children() a little bit
No need to worry about inline children if children are not inline(!)
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutBlock.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutBlock.cpp b/Libraries/LibWeb/Layout/LayoutBlock.cpp index 7c5329d330..dc41250d06 100644 --- a/Libraries/LibWeb/Layout/LayoutBlock.cpp +++ b/Libraries/LibWeb/Layout/LayoutBlock.cpp @@ -143,15 +143,10 @@ void LayoutBlock::layout_block_children(LayoutMode layout_mode) { ASSERT(!children_are_inline()); float content_height = 0; - for_each_child([&](auto& child) { - // FIXME: What should we do here? Something like a <table> might have a bunch of useless text children.. - if (child.is_inline()) - return; - auto& child_block = static_cast<LayoutBlock&>(child); - child_block.layout(layout_mode); - - if (!child_block.is_absolutely_positioned()) - content_height = max(content_height, child_block.effective_offset().y() + child_block.height() + child_block.box_model().margin_box(*this).bottom); + for_each_child_of_type<LayoutBlock>([&](auto& child) { + child.layout(layout_mode); + if (!child.is_absolutely_positioned()) + content_height = max(content_height, child.effective_offset().y() + child.height() + child.box_model().margin_box(*this).bottom); }); if (layout_mode != LayoutMode::Default) { float max_width = 0; |