Bug 1374233 - Part 5: Use NonNegativeLength and NonNegativeAu for border-spacing.

We already have NonNegativeLength and NonNegativeAu, so we can re-use it
to define the specified value and the computed value of border-spacing.
And then implement ToAnimatedValue for it.

MozReview-Commit-ID: CLckpKMYVXU
This commit is contained in:
Boris Chiou 2017-07-21 13:35:06 +08:00
parent 2ef38ce67a
commit 190cd5b952
8 changed files with 67 additions and 33 deletions

View file

@ -27,7 +27,7 @@ use style::logical_geometry::LogicalSize;
use style::properties::ComputedValues;
use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW};
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
use style::values::computed::{LengthOrPercentageOrAuto, NonNegativeAu};
use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance};
use table_row::TableRowFlow;
use table_wrapper::TableLayout;
@ -190,8 +190,8 @@ impl TableFlow {
border_collapse::T::separate => style.get_inheritedtable().border_spacing,
border_collapse::T::collapse => {
border_spacing::T {
horizontal: Au(0),
vertical: Au(0),
horizontal: NonNegativeAu::zero(),
vertical: NonNegativeAu::zero(),
}
}
}
@ -202,7 +202,7 @@ impl TableFlow {
if num_columns == 0 {
return Au(0);
}
self.spacing().horizontal * (num_columns as i32 + 1)
self.spacing().horizontal.0 * (num_columns as i32 + 1)
}
}
@ -469,7 +469,7 @@ impl Flow for TableFlow {
fn assign_block_size(&mut self, _: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table");
let vertical_spacing = self.spacing().vertical;
let vertical_spacing = self.spacing().vertical.0;
self.block_flow.assign_block_size_for_table_like_flow(vertical_spacing)
}