mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibWeb: Use entire margin box of floats when testing for intrusions
This commit is contained in:
parent
389f47f6fe
commit
54fb5af9ee
1 changed files with 3 additions and 3 deletions
|
@ -642,7 +642,7 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
|
|||
}
|
||||
|
||||
if (fits_on_line) {
|
||||
auto const previous_rect = border_box_rect_in_ancestor_coordinate_space(previous_box.box, root(), m_state);
|
||||
auto const previous_rect = margin_box_rect_in_ancestor_coordinate_space(previous_box.box, root(), m_state);
|
||||
if (previous_rect.contains_vertically(y_in_root + side_data.y_offset)) {
|
||||
// This box touches another already floating box. Stack after others.
|
||||
offset_from_edge = wanted_offset_from_edge;
|
||||
|
@ -759,7 +759,7 @@ BlockFormattingContext::SpaceUsedByFloats BlockFormattingContext::space_used_by_
|
|||
auto const& floating_box = *floating_box_ptr;
|
||||
auto const& floating_box_state = m_state.get(floating_box.box);
|
||||
// NOTE: The floating box is *not* in the final horizontal position yet, but the size and vertical position is valid.
|
||||
auto rect = border_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state);
|
||||
auto rect = margin_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state);
|
||||
if (rect.contains_vertically(y)) {
|
||||
space_used_by_floats.left = floating_box.offset_from_edge
|
||||
+ floating_box_state.content_width()
|
||||
|
@ -772,7 +772,7 @@ BlockFormattingContext::SpaceUsedByFloats BlockFormattingContext::space_used_by_
|
|||
auto const& floating_box = *floating_box_ptr;
|
||||
auto const& floating_box_state = m_state.get(floating_box.box);
|
||||
// NOTE: The floating box is *not* in the final horizontal position yet, but the size and vertical position is valid.
|
||||
auto rect = border_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state);
|
||||
auto rect = margin_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state);
|
||||
if (rect.contains_vertically(y)) {
|
||||
space_used_by_floats.right = floating_box.offset_from_edge
|
||||
+ floating_box_state.margin_box_left();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue