diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index c84220ce51..e4be518ad8 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -396,6 +396,22 @@ void BlockFormattingContext::layout_inline_children(BlockContainer const& block_ InlineFormattingContext context(m_state, block_container, *this); context.run(block_container, layout_mode); + + float max_line_width = 0; + float content_height = 0; + + auto& block_container_state = m_state.get_mutable(block_container); + + for (auto& line_box : block_container_state.line_boxes) { + max_line_width = max(max_line_width, line_box.width()); + content_height += line_box.height(); + } + + if (layout_mode != LayoutMode::Normal) { + block_container_state.content_width = max_line_width; + } + + block_container_state.content_height = content_height; } void BlockFormattingContext::layout_block_level_children(BlockContainer const& block_container, LayoutMode layout_mode) |