mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Return CSSPixels from calculate_inner_height()
Similar to calculate_inner_width(), let's make the caller responsible for handling "auto" instead of returning the input height as is when when it cannot be resolved.
This commit is contained in:
committed by
Andreas Kling
parent
05a1dbeb91
commit
39abd9095e
@@ -464,17 +464,18 @@ void BlockFormattingContext::compute_height(Box const& box, AvailableSpace const
|
||||
if (should_treat_height_as_auto(box, available_space)) {
|
||||
height = compute_auto_height_for_block_level_element(box, m_state.get(box).available_inner_space_or_constraints_from(available_space));
|
||||
} else {
|
||||
height = calculate_inner_height(box, available_space.height, computed_values.height()).to_px(box);
|
||||
height = calculate_inner_height(box, available_space.height, computed_values.height());
|
||||
}
|
||||
}
|
||||
|
||||
if (!should_treat_max_height_as_none(box, available_space.height)) {
|
||||
auto max_height = calculate_inner_height(box, available_space.height, computed_values.max_height());
|
||||
if (!max_height.is_auto())
|
||||
height = min(height, max_height.to_px(box));
|
||||
if (!computed_values.max_height().is_auto()) {
|
||||
auto max_height = calculate_inner_height(box, available_space.height, computed_values.max_height());
|
||||
height = min(height, max_height);
|
||||
}
|
||||
}
|
||||
if (!computed_values.min_height().is_auto()) {
|
||||
height = max(height, calculate_inner_height(box, available_space.height, computed_values.min_height()).to_px(box));
|
||||
height = max(height, calculate_inner_height(box, available_space.height, computed_values.min_height()));
|
||||
}
|
||||
|
||||
if (box.document().in_quirks_mode()
|
||||
|
||||
Reference in New Issue
Block a user