layout: Make a new ContainingBlockSize type (#34565)

This might make caching these values a bit easier in the future.
Correcting the visibility of `ContainingBlock` also exposed some new
rustc and clippy warnings that are fixed here.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-12-11 15:40:04 +01:00 committed by GitHub
parent 064569ff3c
commit f1b8d49e77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 192 additions and 158 deletions

View file

@ -521,9 +521,10 @@ impl ReplacedContents {
};
// <https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing>
let inline_stretch_size = Au::zero().max(containing_block.inline_size - pbm_sums.inline);
let inline_stretch_size = Au::zero().max(containing_block.size.inline - pbm_sums.inline);
let block_stretch_size = containing_block
.block_size
.size
.block
.non_auto()
.map(|block_size| Au::zero().max(block_size - pbm_sums.block));