mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Use space_used_by_floats to get x offset of box that creates BFC
y of box should be taken in account while calculating space used by floats.
This commit is contained in:
parent
daece542f5
commit
3922349b71
Notes:
sideshowbarker
2024-07-17 08:59:18 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/3922349b71 Pull-request: https://github.com/SerenityOS/serenity/pull/16420 Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 2 deletions
|
@ -487,8 +487,10 @@ void BlockFormattingContext::place_block_level_element_in_normal_flow_horizontal
|
|||
|
||||
if ((!m_left_floats.current_boxes.is_empty() || !m_right_floats.current_boxes.is_empty())
|
||||
&& creates_block_formatting_context(child_box)) {
|
||||
available_width_within_containing_block -= m_left_floats.current_width + m_right_floats.current_width;
|
||||
x += m_left_floats.current_width;
|
||||
auto box_in_root_rect = content_box_rect_in_ancestor_coordinate_space(child_box, root(), m_state);
|
||||
auto space = space_used_by_floats(box_in_root_rect.y());
|
||||
available_width_within_containing_block -= space.left + space.right;
|
||||
x += space.left;
|
||||
}
|
||||
|
||||
if (child_box.containing_block()->computed_values().text_align() == CSS::TextAlign::LibwebCenter) {
|
||||
|
|
Loading…
Reference in a new issue