mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Honor box-sizing for block-level replaced element widths
Before this change, we were always behaving as if box-sizing were content-box for block-level replaced element widths. This fixes the squishy logo on https://videolan.org/
This commit is contained in:
parent
6da1dfa8f2
commit
11fa5fdd47
Notes:
github-actions[bot]
2025-07-14 09:17:25 +00:00
Author: https://github.com/awesomekling
Commit: 11fa5fdd47
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5434
Reviewed-by: https://github.com/gmta ✅
3 changed files with 31 additions and 1 deletions
|
@ -432,13 +432,14 @@ void BlockFormattingContext::compute_width_for_block_level_replaced_element_in_n
|
|||
margin_right = zero_value;
|
||||
|
||||
auto& box_state = m_state.get_mutable(box);
|
||||
box_state.set_content_width(compute_width_for_replaced_element(box, available_space));
|
||||
auto width = compute_width_for_replaced_element(box, available_space);
|
||||
box_state.margin_left = margin_left.to_px(box);
|
||||
box_state.margin_right = margin_right.to_px(box);
|
||||
box_state.border_left = computed_values.border_left().width;
|
||||
box_state.border_right = computed_values.border_right().width;
|
||||
box_state.padding_left = padding_left;
|
||||
box_state.padding_right = padding_right;
|
||||
box_state.set_content_width(calculate_inner_width(box, available_space.width, CSS::Size::make_px(width)));
|
||||
}
|
||||
|
||||
void BlockFormattingContext::resolve_used_height_if_not_treated_as_auto(Box const& box, AvailableSpace const& available_space)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue