mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Compute height early when possible for floating boxes
This is preparation for the next commit, which will make flex layout relinquish control of the flex container cross size to the parent formatting context.
This commit is contained in:
parent
aa59419529
commit
ca53eefe11
Notes:
sideshowbarker
2024-07-17 08:35:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ca53eefe11 Pull-request: https://github.com/SerenityOS/serenity/pull/23742
1 changed files with 5 additions and 0 deletions
|
@ -914,6 +914,11 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
|
|||
resolve_vertical_box_model_metrics(box);
|
||||
|
||||
compute_width(box, available_space, layout_mode);
|
||||
|
||||
// NOTE: Flex containers with `auto` height are treated as `max-content`, so we can compute their height early.
|
||||
if (box.is_replaced_box() || box.display().is_flex_inside())
|
||||
compute_height(box, available_space);
|
||||
|
||||
auto independent_formatting_context = layout_inside(box, layout_mode, box_state.available_inner_space_or_constraints_from(available_space));
|
||||
compute_height(box, available_space);
|
||||
|
||||
|
|
Loading…
Reference in a new issue