mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
layout: Floor content-box size by zero when stretching flex item (#38521)
When stretching the cross size of a flex item to its flex line, we were computing the stretch size by subtracting padding, border and margin from the line size. However, this could result in a negative amount for the content-box cross size. Therefore, this floors it by zero. Testing: Adding new tests Fixes: #38517 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
cf99d437fb
commit
87538282db
4 changed files with 99 additions and 1 deletions
|
@ -1552,7 +1552,7 @@ impl InitialFlexLineLayout<'_> {
|
|||
cross_axis,
|
||||
Size::Stretch,
|
||||
Au::zero,
|
||||
Some(final_line_cross_size - item.item.pbm_auto_is_zero.cross),
|
||||
Some(Au::zero().max(final_line_cross_size - item.item.pbm_auto_is_zero.cross)),
|
||||
|| content_size.into(),
|
||||
// Tables have a special sizing in the block axis in that handles collapsed rows,
|
||||
// but it would prevent stretching. So we only recognize tables in the inline axis.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue