mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Bug 1374233 - Part 4: Add NonNegativeLengthOr{Auto|Normal|Number}.
Add NonNegativeLength, which could be computed to NonNegativeAu. So we can declare Either<NonNegativeLength, X>, X=Auto, Normal, or Number. NonNegativeLengthOrAuto is for column-width. NonNegativeLengthOrNormal is for column-gap. NonNegativeLengthOrNumber is for -moz-tab-size. MozReview-Commit-ID: AfU8XpA1um0
This commit is contained in:
parent
234d2c1b32
commit
2ef38ce67a
8 changed files with 68 additions and 20 deletions
|
@ -98,14 +98,14 @@ 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,
|
||||
Either::First(len) => len.0,
|
||||
Either::Second(_normal) => self.block_flow.fragment.style.get_font().font_size.0,
|
||||
};
|
||||
|
||||
let mut column_count;
|
||||
if let Either::First(column_width) = column_style.column_width {
|
||||
column_count =
|
||||
max(1, (content_inline_size + column_gap).0 / (column_width + column_gap).0);
|
||||
max(1, (content_inline_size + column_gap).0 / (column_width.0 + column_gap).0);
|
||||
if let Either::First(specified_column_count) = column_style.column_count {
|
||||
column_count = min(column_count, specified_column_count as i32);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue