layout: Improve logic for block size of table (#34947)

The containing block for children already has the size coming from the
style and the rules of the parent formatting context, so no need to try
to recompute it.

This allows removing a bunch of functions, and fixes some problems when
the table is a flex item.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-01-13 03:50:25 -08:00 committed by GitHub
parent f66cd172d6
commit 4332c1e405
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 8 additions and 119 deletions

View file

@ -733,22 +733,6 @@ impl From<StyleMaxSize> for Size<LengthPercentage> {
}
impl LogicalVec2<Size<LengthPercentage>> {
pub(crate) fn percentages_relative_to(
&self,
containing_block: &ContainingBlock,
) -> LogicalVec2<Size<Au>> {
self.map_inline_and_block_axes(
|inline_size| inline_size.map(|lp| lp.to_used_value(containing_block.size.inline)),
|block_size| {
block_size
.maybe_map(|lp| {
lp.maybe_to_used_value(containing_block.size.block.to_definite())
})
.unwrap_or_default()
},
)
}
pub(crate) fn maybe_percentages_relative_to_basis(
&self,
basis: &LogicalVec2<Option<Au>>,