1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibWeb: Remove awkward BFC::compute_theoretical_height() function

This was used by FFC to estimate the height of flex items after
performing layout inside them.

Now that we have automatic_content_height(), we no longer need this
awkward API and we can fold it into BFC's own height calculation.
This commit is contained in:
Andreas Kling 2022-09-24 13:53:23 +02:00
parent e181269da7
commit f0ac687823
2 changed files with 4 additions and 8 deletions

View file

@ -321,8 +321,10 @@ void BlockFormattingContext::compute_width_for_block_level_replaced_element_in_n
m_state.get_mutable(box).set_content_width(compute_width_for_replaced_element(m_state, box));
}
float BlockFormattingContext::compute_theoretical_height(LayoutState const& state, Box const& box)
void BlockFormattingContext::compute_height(Box const& box, LayoutState& state)
{
resolve_vertical_box_model_metrics(box, *box.containing_block(), state);
auto const& computed_values = box.computed_values();
auto containing_block_height = CSS::Length::make_px(containing_block_height_for(box, state));
@ -344,13 +346,8 @@ float BlockFormattingContext::compute_theoretical_height(LayoutState const& stat
auto specified_min_height = computed_values.min_height().resolved(box, containing_block_height).resolved(box);
if (!specified_min_height.is_auto())
height = max(height, specified_min_height.to_px(box));
return height;
}
void BlockFormattingContext::compute_height(Box const& box, LayoutState& state)
{
resolve_vertical_box_model_metrics(box, *box.containing_block(), state);
state.get_mutable(box).set_content_height(compute_theoretical_height(state, box));
state.get_mutable(box).set_content_height(height);
}
void BlockFormattingContext::layout_inline_children(BlockContainer const& block_container, LayoutMode layout_mode)