mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
f66cd172d6
commit
4332c1e405
10 changed files with 8 additions and 119 deletions
|
@ -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>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue