mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Allow raising FloatContext ceiling after processing box with overflow (#30539)
When a box has overflow, any floats placed in that box will lower the float ceiling into the overflow. If no float is placed in the box though, the ceiling should be the block position where the overflow starts. We already know where this is, because we might be passing a negative value for the new block position after processing a box (content_size - actual_size would be negative). This negative value never raises the ceiling though since a maximum is used. In the case that there is overflow, this change allows raising the ceiling, but never passed the lowest float. This necessitates keeping two values for the ceiling: one for floats and one for non-floats. Fixes #30304.
This commit is contained in:
parent
59ea908294
commit
2c341d9e69
6 changed files with 35 additions and 25 deletions
|
@ -761,6 +761,12 @@ fn layout_in_flow_non_replaced_block_level_same_formatting_context(
|
|||
// Account for padding and border. We also might have to readjust the
|
||||
// `bfc_relative_block_position` if it was different from the content size (i.e. was
|
||||
// non-`auto` and/or was affected by min/max block size).
|
||||
//
|
||||
// If this adjustment is positive, that means that a block size was specified, but
|
||||
// the content inside had a smaller block size. If this adjustment is negative, a
|
||||
// block size was specified, but the content inside overflowed this container in
|
||||
// the block direction. In that case, the ceiling for floats is effectively raised
|
||||
// as long as no floats in the overflowing content lowered it.
|
||||
sequential_layout_state.advance_block_position(
|
||||
(block_size - content_block_size) + pbm.padding.block_end + pbm.border.block_end,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue