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
|
@ -251,18 +251,6 @@ impl<'a> PlacementAmongFloats<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// After placing a table and then laying it out, it may turn out wider than what
|
||||
/// we initially expected. This method takes care of updating the data so that
|
||||
/// the next place() can find the right area for the new size.
|
||||
/// Note that if the new size is smaller, placement won't backtrack to consider
|
||||
/// areas that weren't big enough for the old size.
|
||||
pub(crate) fn set_inline_size(&mut self, inline_size: Au, pbm: &PaddingBorderMargin) {
|
||||
self.object_size.inline = inline_size;
|
||||
self.max_inline_end = (self.float_context.containing_block_info.inline_end -
|
||||
pbm.margin.inline_end.auto_is(Au::zero))
|
||||
.max(self.min_inline_start + inline_size);
|
||||
}
|
||||
|
||||
/// After placing an object with `height: auto` (and using the minimum inline and
|
||||
/// block size as the object size) and then laying it out, try to fit the object into
|
||||
/// the current set of bands, given block size after layout and the available inline
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue