aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/multicol.rs
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2024-09-20 16:48:27 +0200
committerGitHub <noreply@github.com>2024-09-20 14:48:27 +0000
commit9597390d2bc6f68492cc9fae6287d0a456cdb3c1 (patch)
tree470d803926620b39f272c38eb455ec4093eec48e /components/layout/multicol.rs
parent4bde9af5159b18eba1b65256de0d2dda328a1eb2 (diff)
downloadservo-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/multicol.rs')
-rw-r--r--components/layout/multicol.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs
index ed82b41fe1c..b143c1215ca 100644
--- a/components/layout/multicol.rs
+++ b/components/layout/multicol.rs
@@ -15,7 +15,7 @@ use log::{debug, trace};
use style::logical_geometry::LogicalSize;
use style::properties::ComputedValues;
use style::values::computed::length::{
- MaxSize, NonNegativeLengthOrAuto, NonNegativeLengthPercentageOrNormal, Size,
+ NonNegativeLengthOrAuto, NonNegativeLengthPercentageOrNormal,
};
use style::values::generics::column::ColumnCount;
@@ -167,14 +167,10 @@ impl Flow for MulticolFlow {
this_fragment_is_empty: true,
available_block_size: {
let style = &self.block_flow.fragment.style;
- let size = match style.content_block_size() {
- Size::Auto => None,
- Size::LengthPercentage(ref lp) => lp.maybe_to_used_value(None),
- };
- let size = size.or_else(|| match style.max_block_size() {
- MaxSize::None => None,
- MaxSize::LengthPercentage(ref lp) => lp.maybe_to_used_value(None),
- });
+ let size = style
+ .content_block_size()
+ .maybe_to_used_value(None)
+ .or_else(|| style.max_block_size().maybe_to_used_value(None));
size.unwrap_or_else(|| {
// FIXME: do column balancing instead