mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Support min/max main keyword sizes in flexbox (#35961)
Adds support for min-content, max-content, fit-content and stretch on the min and max main size properties of a flex item. I'm removing `automatic_min_size()` and `flex_base_size()` because they would need to share so much code among themselves and their one caller that it's simpler to just inline the code. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
2362e4c134
commit
ba6c3916fc
12 changed files with 160 additions and 444 deletions
|
@ -729,12 +729,6 @@ impl<T: Clone> Size<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn to_auto_or(&self) -> AutoOr<T> {
|
||||
self.to_numeric()
|
||||
.map_or(AutoOr::Auto, AutoOr::LengthPercentage)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn map<U>(&self, f: impl FnOnce(T) -> U) -> Size<U> {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue