diff options
author | Oriol Brufau <obrufau@igalia.com> | 2024-09-20 16:48:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-20 14:48:27 +0000 |
commit | 9597390d2bc6f68492cc9fae6287d0a456cdb3c1 (patch) | |
tree | 470d803926620b39f272c38eb455ec4093eec48e /components/layout/flex.rs | |
parent | 4bde9af5159b18eba1b65256de0d2dda328a1eb2 (diff) | |
download | servo-9597390d2bc6f68492cc9fae6287d0a456cdb3c1.tar.gz servo-9597390d2bc6f68492cc9fae6287d0a456cdb3c1.zip |
Enable min-content, max-content, fit-content and stretch (#33492)
For the sizing properties.
We don't actually support them yet, just treating them as
the initial value.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/layout/flex.rs')
-rw-r--r-- | components/layout/flex.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/components/layout/flex.rs b/components/layout/flex.rs index 76df1f1ce0e..f2aa96a0ec9 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -48,11 +48,11 @@ impl AxisSize { /// containing block size, min constraint, and max constraint pub fn new(size: &Size, content_size: Option<Au>, min: &Size, max: &MaxSize) -> AxisSize { match size { - Size::Auto => AxisSize::MinMax(SizeConstraint::new(content_size, min, max, None)), Size::LengthPercentage(ref lp) => match lp.maybe_to_used_value(content_size) { Some(length) => AxisSize::Definite(length), None => AxisSize::Infinite, }, + _ => AxisSize::MinMax(SizeConstraint::new(content_size, min, max, None)), } } } @@ -72,10 +72,7 @@ fn from_flex_basis(flex_basis: &FlexBasis, main_length: &Size, containing_length _ => width, }; - match width { - Size::Auto => MaybeAuto::Auto, - Size::LengthPercentage(ref lp) => MaybeAuto::Specified(lp.to_used_value(containing_length)), - } + MaybeAuto::from_option(width.to_used_value(containing_length)) } /// Represents a child in a flex container. Most fields here are used in |