mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibWeb: Make intrinsic heights dependent on available width
After speaking with fantasai at CSSWG about this, it turns out I had misunderstood intrinsic heights. I originally believed all intrinsic sizes had to be computed with no influence from the surrounding context. As it turns out, intrinsic heights *are* influenced by the available width, since it's needed to determine where lines break. The APIs for calculating min-content and max-content heights now take the available width as inputs. This instantly improves layout in many cases where we'd previously make things way too wide.
This commit is contained in:
@@ -311,7 +311,7 @@ void BlockFormattingContext::compute_height(Box const& box, AvailableSpace const
|
||||
height = compute_height_for_replaced_element(m_state, verify_cast<ReplacedBox>(box), available_space);
|
||||
} else {
|
||||
if (should_treat_height_as_auto(box, available_space)) {
|
||||
height = compute_auto_height_for_block_level_element(box);
|
||||
height = compute_auto_height_for_block_level_element(box, available_space);
|
||||
} else {
|
||||
height = computed_values.height().resolved(box, containing_block_height).to_px(box);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user