mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +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:
parent
e181269da7
commit
f0ac687823
2 changed files with 4 additions and 8 deletions
|
@ -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));
|
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 const& computed_values = box.computed_values();
|
||||||
auto containing_block_height = CSS::Length::make_px(containing_block_height_for(box, state));
|
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);
|
auto specified_min_height = computed_values.min_height().resolved(box, containing_block_height).resolved(box);
|
||||||
if (!specified_min_height.is_auto())
|
if (!specified_min_height.is_auto())
|
||||||
height = max(height, specified_min_height.to_px(box));
|
height = max(height, specified_min_height.to_px(box));
|
||||||
return height;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlockFormattingContext::compute_height(Box const& box, LayoutState& state)
|
state.get_mutable(box).set_content_height(height);
|
||||||
{
|
|
||||||
resolve_vertical_box_model_metrics(box, *box.containing_block(), state);
|
|
||||||
state.get_mutable(box).set_content_height(compute_theoretical_height(state, box));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockFormattingContext::layout_inline_children(BlockContainer const& block_container, LayoutMode layout_mode)
|
void BlockFormattingContext::layout_inline_children(BlockContainer const& block_container, LayoutMode layout_mode)
|
||||||
|
|
|
@ -30,7 +30,6 @@ public:
|
||||||
auto const& left_side_floats() const { return m_left_floats; }
|
auto const& left_side_floats() const { return m_left_floats; }
|
||||||
auto const& right_side_floats() const { return m_right_floats; }
|
auto const& right_side_floats() const { return m_right_floats; }
|
||||||
|
|
||||||
static float compute_theoretical_height(LayoutState const&, Box const&);
|
|
||||||
void compute_width(Box const&, LayoutMode = LayoutMode::Normal);
|
void compute_width(Box const&, LayoutMode = LayoutMode::Normal);
|
||||||
|
|
||||||
// https://www.w3.org/TR/css-display/#block-formatting-context-root
|
// https://www.w3.org/TR/css-display/#block-formatting-context-root
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue