aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/multicol.rs
diff options
context:
space:
mode:
authorBoris Chiou <boris.chiou@gmail.com>2017-09-13 14:26:51 +0800
committerBoris Chiou <boris.chiou@gmail.com>2017-09-13 18:05:14 +0800
commita949e2a0570e41816cd1a2fa3ed5ebd314212dda (patch)
tree79fa5a3535cceb6bf500d938ca7b45ca6af09fc7 /components/layout/multicol.rs
parentcad3aff508fdf47036237ead519791f180e1ea3d (diff)
downloadservo-a949e2a0570e41816cd1a2fa3ed5ebd314212dda.tar.gz
servo-a949e2a0570e41816cd1a2fa3ed5ebd314212dda.zip
Introduce CSSPixelLength and update NonNegativeLength.
First, we define computed::CSSPixelLength which contains a CSSFloat, a pixel value, and then we replace computed::Length with CSSPixelLength. Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength, FontRelativeLength, ViewportPercentageLength, CharacterWidth, and PhysicalLength is CSSPixelLength. Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
Diffstat (limited to 'components/layout/multicol.rs')
-rw-r--r--components/layout/multicol.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs
index 3e7cb66c2c9..b1ffc704d77 100644
--- a/components/layout/multicol.rs
+++ b/components/layout/multicol.rs
@@ -97,15 +97,16 @@ impl Flow for MulticolFlow {
{
let column_style = self.block_flow.fragment.style.get_column();
- let column_gap = match column_style.column_gap {
- Either::First(len) => len.0,
- Either::Second(_normal) => self.block_flow.fragment.style.get_font().font_size.0,
- };
+ let column_gap = Au::from(match column_style.column_gap {
+ Either::First(len) => len,
+ Either::Second(_normal) => self.block_flow.fragment.style.get_font().font_size,
+ });
let mut column_count;
if let Either::First(column_width) = column_style.column_width {
+ let column_width = Au::from(column_width);
column_count =
- max(1, (content_inline_size + column_gap).0 / (column_width.0 + column_gap).0);
+ max(1, (content_inline_size + column_gap).0 / (column_width + column_gap).0);
if let Either::First(specified_column_count) = column_style.column_count {
column_count = min(column_count, specified_column_count.0 as i32);
}