diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-01-07 16:43:10 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-01-08 12:00:42 +0100 |
commit | 4a31509215c70c8810019880b83025182a80b6e0 (patch) | |
tree | d8ebea49ee3ca7519739f3af63417c852aefcc4c /components/layout/multicol.rs | |
parent | ca503b4908cb45c20cc6777f9d01253057a86a97 (diff) | |
download | servo-4a31509215c70c8810019880b83025182a80b6e0.tar.gz servo-4a31509215c70c8810019880b83025182a80b6e0.zip |
style: Fix servo build.
This also fixes a bunch of calc handling issues and such.
Also remove tests that no longer compile and are covered by WPT.
Diffstat (limited to 'components/layout/multicol.rs')
-rw-r--r-- | components/layout/multicol.rs | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index 294670f0a1e..e0234454b27 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -154,11 +154,22 @@ impl Flow for MulticolFlow { this_fragment_is_empty: true, available_block_size: { let style = &self.block_flow.fragment.style; - if let LengthOrPercentageOrAuto::Length(length) = style.content_block_size() { - Au::from(length) - } else if let LengthOrPercentageOrNone::Length(length) = style.max_block_size() { - Au::from(length) - } else { + let size = match style.content_block_size() { + LengthOrPercentageOrAuto::Auto => None, + LengthOrPercentageOrAuto::LengthOrPercentage(ref lp) => { + lp.maybe_to_used_value(None) + } + }; + let size = size.or_else(|| { + match style.max_block_size() { + LengthOrPercentageOrNone::None => None, + LengthOrPercentageOrNone::LengthOrPercentage(ref lp) => { + lp.maybe_to_used_value(None) + } + } + }); + + size.unwrap_or_else(|| { // FIXME: do column balancing instead // FIXME: (until column balancing) substract margins/borders/padding LogicalSize::from_physical( @@ -166,7 +177,7 @@ impl Flow for MulticolFlow { ctx.shared_context().viewport_size(), ) .block - } + }) }, }); |