mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Remove wrong optimization when placing table among floats (#35207)
When we try to place a table next to some floats, and it doesn't fit vertically, then we try again considering more floats. And as an optimization we were using the previous width of the table as a minimum. However, this was wrong, because the table might accept a smaller width when the available space is smaller than beforehand. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
53fcc98585
commit
bc7cdab46f
4 changed files with 41 additions and 16 deletions
|
@ -1361,11 +1361,10 @@ impl IndependentNonReplacedContents {
|
|||
// up until after trying to place it. If the table doesn't fit into this
|
||||
// positioning rectangle due to incompatibility in the inline axis,
|
||||
// then retry at another location.
|
||||
// Even if it would fit in the inline axis, we may end up having to retry
|
||||
// at another location due to incompatibility in the block axis. Therefore,
|
||||
// always update the size in the PlacementAmongFloats as an optimization.
|
||||
// Note if we get a narrower size due to collapsed columns, we don't backtrack
|
||||
// to consider areas that we thought weren't big enough.
|
||||
// TODO: Should `minimum_size_of_block.inline` be zero for tables?
|
||||
let outer_inline_size = inline_size + pbm.padding_border_sums.inline;
|
||||
placement.set_inline_size(outer_inline_size, &pbm);
|
||||
if outer_inline_size > placement_rect.size.inline {
|
||||
positioning_context.truncate(&positioning_context_length);
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue