mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
layout: Enforce min-content min main size of flex-level tables (#36469)
Additionally to the minimum specified in min-width or min-height, tables also enforce a `min-content` minimum. This was handled in `Sizes::resolve()`, but flex items don't use that. So this patch moves the logic into `Size::resolve_for_min()`. Testing: Covered by WPT Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
56e7c21fe7
commit
64fe52e918
5 changed files with 31 additions and 22 deletions
|
@ -2155,10 +2155,7 @@ impl FlexItem<'_> {
|
|||
|
||||
#[inline]
|
||||
fn is_table(&self) -> bool {
|
||||
match &self.box_.independent_formatting_context.contents {
|
||||
IndependentFormattingContextContents::NonReplaced(content) => content.is_table(),
|
||||
IndependentFormattingContextContents::Replaced(_) => false,
|
||||
}
|
||||
self.box_.is_table()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2366,6 +2363,7 @@ impl FlexItemBox {
|
|||
get_automatic_minimum_size,
|
||||
stretch_size.main,
|
||||
&main_content_sizes,
|
||||
self.is_table(),
|
||||
);
|
||||
|
||||
FlexItem {
|
||||
|
@ -2724,4 +2722,12 @@ impl FlexItemBox {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn is_table(&self) -> bool {
|
||||
match &self.independent_formatting_context.contents {
|
||||
IndependentFormattingContextContents::NonReplaced(content) => content.is_table(),
|
||||
IndependentFormattingContextContents::Replaced(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue