From 622d43da8aa18c195b8a3f0370689a262c364ba3 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Thu, 8 Dec 2016 15:49:42 -0800 Subject: [PATCH] Simplify propagation of column sizes from TableWrapperFlow --- components/layout/table_row.rs | 4 ---- components/layout/table_wrapper.rs | 19 +++++-------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index 6db82388d0a..20ba8736265 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -751,10 +751,6 @@ pub fn propagate_column_inline_sizes_to_child( // // FIXME(pcwalton): This seems inefficient. Reference count it instead? match child_flow.class() { - FlowClass::Table => { - let child_table_flow = child_flow.as_mut_table(); - child_table_flow.column_computed_inline_sizes = column_computed_inline_sizes.to_vec(); - } FlowClass::TableRowGroup => { let child_table_rowgroup_flow = child_flow.as_mut_table_rowgroup(); child_table_rowgroup_flow.spacing = *border_spacing; diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index 62f4d76b1b2..7510ae3988a 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -37,7 +37,6 @@ use style::properties::ServoComputedValues; use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize}; -use table_row; #[derive(Copy, Clone, Serialize, Debug)] pub enum TableLayout { @@ -394,7 +393,6 @@ impl Flow for TableWrapperFlow { } }; - let border_spacing = self.block_flow.fragment.style().get_inheritedtable().border_spacing; match assigned_column_inline_sizes { None => { self.block_flow @@ -410,18 +408,11 @@ impl Flow for TableWrapperFlow { inline_start_content_edge, inline_end_content_edge, content_inline_size, - |child_flow, - _child_index, - _content_inline_size, - writing_mode, - _inline_start_margin_edge, - _inline_end_margin_edge| { - table_row::propagate_column_inline_sizes_to_child( - child_flow, - writing_mode, - assigned_column_inline_sizes, - &border_spacing, - &mut vec![]); + |child_flow, _, _, _, _, _| { + if child_flow.class() == FlowClass::Table { + child_flow.as_mut_table().column_computed_inline_sizes = + assigned_column_inline_sizes.to_vec(); + } }) } }