mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibWeb: Fix IFC over-shrinking the available space for line boxes
After accounting for left-side floats, we have to subtract the offset of the IFC's containing block again, to get the real starting X offset for the current line. This was done correctly in leftmost_x_offset_at() but incorrectly in available_space_for_line(), causing IFC to break lines too early in cases where the containing block had a non-zero X offset from the BFC root block.
This commit is contained in:
parent
8d5768b103
commit
83afc1154c
|
@ -57,7 +57,7 @@ float InlineFormattingContext::available_space_for_line(float y) const
|
|||
auto const& containing_block_state = m_state.get(containing_block());
|
||||
auto const& root_block_state = m_state.get(parent().root());
|
||||
|
||||
space.left = max(space.left, containing_block_state.offset.x());
|
||||
space.left = max(space.left, containing_block_state.offset.x()) - containing_block_state.offset.x();
|
||||
space.right = min(root_block_state.content_width - space.right, containing_block_state.offset.x() + containing_block_state.content_width);
|
||||
|
||||
return space.right - space.left;
|
||||
|
|
Loading…
Reference in a new issue