diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-08 14:31:35 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-08 15:03:55 +0200 |
commit | 7ba6eb37fc315ea00c0017f578f84aaf749c7044 (patch) | |
tree | 80c07e70bc6569e16692d96397f8a684603c95b2 /Userland | |
parent | af73a5d921210cefc54d0fb43100715d360886db (diff) | |
download | serenity-7ba6eb37fc315ea00c0017f578f84aaf749c7044.zip |
LibWeb: Rename confusing parameter to layout_block_level_box()
It wasn't the content height, but rather the the bottom edge of the
lowest margin box.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 12 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 113d30d056..68accceee3 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -386,7 +386,7 @@ void BlockFormattingContext::layout_inline_children(BlockContainer const& block_ block_container_state.set_content_height(content_height); } -void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContainer const& block_container, LayoutMode layout_mode, float& content_height) +void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContainer const& block_container, LayoutMode layout_mode, float& bottom_of_lowest_margin_box) { auto& box_state = m_state.get_mutable(box); @@ -401,7 +401,7 @@ void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContain if (box.is_floating()) { layout_floating_box(box, block_container, layout_mode); - content_height = max(content_height, box_state.offset.y() + box_state.content_height() + box_state.margin_box_bottom()); + bottom_of_lowest_margin_box = max(bottom_of_lowest_margin_box, box_state.offset.y() + box_state.content_height() + box_state.margin_box_bottom()); return; } @@ -437,7 +437,7 @@ void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContain layout_list_item_marker(static_cast<ListItemBox const&>(box)); } - content_height = max(content_height, box_state.offset.y() + box_state.content_height() + box_state.margin_box_bottom()); + bottom_of_lowest_margin_box = max(bottom_of_lowest_margin_box, box_state.offset.y() + box_state.content_height() + box_state.margin_box_bottom()); if (independent_formatting_context) independent_formatting_context->parent_context_did_dimension_child_root_box(); @@ -460,7 +460,7 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer const& b { VERIFY(!block_container.children_are_inline()); - float content_height = 0; + float bottom_of_lowest_margin_box = 0; if (layout_mode == LayoutMode::IntrinsicSizing) { auto& block_container_state = m_state.get_mutable(block_container); @@ -471,7 +471,7 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer const& b } block_container.for_each_child_of_type<Box>([&](Box& box) { - layout_block_level_box(box, block_container, layout_mode, content_height); + layout_block_level_box(box, block_container, layout_mode, bottom_of_lowest_margin_box); return IterationDecision::Continue; }); @@ -480,7 +480,7 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer const& b if (block_container.computed_values().width().is_auto() || block_container_state.width_constraint != SizeConstraint::None) block_container_state.set_content_width(greatest_child_width(block_container)); if (block_container.computed_values().height().is_auto() || block_container_state.height_constraint != SizeConstraint::None) - block_container_state.set_content_height(content_height); + block_container_state.set_content_height(bottom_of_lowest_margin_box); } } diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h index 690b0dfcc1..fe6de446b4 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.h @@ -47,7 +47,7 @@ public: void layout_floating_box(Box const& child, BlockContainer const& containing_block, LayoutMode, LineBuilder* = nullptr); - void layout_block_level_box(Box const&, BlockContainer const&, LayoutMode, float& content_height); + void layout_block_level_box(Box const&, BlockContainer const&, LayoutMode, float& bottom_of_lowest_margin_box); private: virtual bool is_block_formatting_context() const final { return true; } |