Replace PositiveIntegerOrAuto by ColumnCount

It was its only use.
This commit is contained in:
Anthony Ramine 2018-02-22 10:16:46 +01:00
parent 363aae6a43
commit 761689f32d
11 changed files with 94 additions and 28 deletions

View file

@ -23,6 +23,7 @@ use style::logical_geometry::LogicalSize;
use style::properties::ComputedValues;
use style::values::Either;
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
use style::values::generics::column::ColumnCount;
#[allow(unsafe_code)]
unsafe impl ::flow::HasBaseFlow for MulticolFlow {}
@ -115,12 +116,12 @@ impl Flow for MulticolFlow {
let column_width = Au::from(column_width);
column_count =
max(1, (content_inline_size + column_gap).0 / (column_width + column_gap).0);
if let Either::First(specified_column_count) = column_style.column_count {
if let ColumnCount::Integer(specified_column_count) = column_style.column_count {
column_count = min(column_count, specified_column_count.0 as i32);
}
} else {
column_count = match column_style.column_count {
Either::First(n) => n.0,
ColumnCount::Integer(n) => n.0,
_ => unreachable!(),
}
}