mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Replace PositiveIntegerOrAuto by ColumnCount
It was its only use.
This commit is contained in:
parent
363aae6a43
commit
761689f32d
11 changed files with 94 additions and 28 deletions
|
@ -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!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue