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
Notes:
sideshowbarker
2024-07-17 17:07:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/83afc1154c
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue