mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
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:
parent
2ef38ce67a
commit
190cd5b952
8 changed files with 67 additions and 33 deletions
|
@ -25,7 +25,7 @@ use style::computed_values::{border_collapse, border_spacing, border_top_style};
|
|||
use style::logical_geometry::{LogicalSize, PhysicalSide, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW};
|
||||
use style::values::computed::{Color, LengthOrPercentageOrAuto};
|
||||
use style::values::computed::{Color, LengthOrPercentageOrAuto, NonNegativeAu};
|
||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
|
||||
use table_cell::{CollapsedBordersForCell, TableCellFlow};
|
||||
|
||||
|
@ -93,8 +93,8 @@ impl TableRowFlow {
|
|||
column_computed_inline_sizes: Vec::new(),
|
||||
incoming_rowspan: Vec::new(),
|
||||
spacing: border_spacing::T {
|
||||
horizontal: Au(0),
|
||||
vertical: Au(0),
|
||||
horizontal: NonNegativeAu::zero(),
|
||||
vertical: NonNegativeAu::zero(),
|
||||
},
|
||||
table_writing_mode: writing_mode,
|
||||
preliminary_collapsed_borders: CollapsedBordersForRow::new(),
|
||||
|
@ -395,7 +395,7 @@ impl Flow for TableRowFlow {
|
|||
None => break,
|
||||
};
|
||||
column_computed_inline_size.size = column_computed_inline_size.size +
|
||||
extra_column_computed_inline_size.size + self.spacing.horizontal;
|
||||
extra_column_computed_inline_size.size + self.spacing.horizontal.0;
|
||||
col += 1;
|
||||
}
|
||||
|
||||
|
@ -818,7 +818,7 @@ fn set_inline_position_of_child_flow(
|
|||
let column_inline_size = column_computed_inline_sizes[*column_index].size;
|
||||
let border_inline_size = match *border_collapse_info {
|
||||
Some(_) => Au(0), // FIXME: Make collapsed borders account for colspan/rowspan.
|
||||
None => border_spacing.horizontal,
|
||||
None => border_spacing.horizontal.0,
|
||||
};
|
||||
if reverse_column_order {
|
||||
*inline_end_margin_edge += column_inline_size + border_inline_size;
|
||||
|
@ -873,9 +873,9 @@ fn set_inline_position_of_child_flow(
|
|||
None => {
|
||||
// Take spacing into account.
|
||||
if reverse_column_order {
|
||||
*inline_end_margin_edge += border_spacing.horizontal;
|
||||
*inline_end_margin_edge += border_spacing.horizontal.0;
|
||||
} else {
|
||||
*inline_start_margin_edge += border_spacing.horizontal;
|
||||
*inline_start_margin_edge += border_spacing.horizontal.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue