aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2016-12-07 18:25:01 -0800
committerMatt Brubeck <mbrubeck@limpet.net>2016-12-09 14:10:43 -0800
commitb77a0a89cf76a15346345c74e712a8d56b6ee517 (patch)
treeb0d372da1267c50394d8e8b5ea515bd73125875a
parent882d5512bb9aa7263864fb18d702c1efb6401914 (diff)
downloadservo-b77a0a89cf76a15346345c74e712a8d56b6ee517.tar.gz
servo-b77a0a89cf76a15346345c74e712a8d56b6ee517.zip
Propagate column info to rows sequentially
This avoids storing it in the rowgroup (which doesn't need it) and ensures that it is done sequentially, which will be important when rowspan support is added to this function. Note that this does not reduce parallelism in the common case where all rows are in the same rowgroup.
-rw-r--r--components/layout/table_row.rs9
-rw-r--r--components/layout/table_rowgroup.rs24
2 files changed, 8 insertions, 25 deletions
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index 272bf85337f..acb052a7134 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -726,10 +726,13 @@ pub fn propagate_column_inline_sizes_to_child(
}
FlowClass::TableRowGroup => {
let child_table_rowgroup_flow = child_flow.as_mut_table_rowgroup();
- child_table_rowgroup_flow.column_computed_inline_sizes =
- column_computed_inline_sizes.to_vec();
child_table_rowgroup_flow.spacing = *border_spacing;
- child_table_rowgroup_flow.table_writing_mode = table_writing_mode;
+ for kid in child_table_rowgroup_flow.block_flow.base.child_iter_mut() {
+ propagate_column_inline_sizes_to_child(kid,
+ table_writing_mode,
+ column_computed_inline_sizes,
+ border_spacing);
+ }
}
FlowClass::TableRow => {
let child_table_row_flow = child_flow.as_mut_table_row();
diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs
index 9c7ace68260..a76d7a82ccf 100644
--- a/components/layout/table_rowgroup.rs
+++ b/components/layout/table_rowgroup.rs
@@ -23,10 +23,9 @@ use std::iter::{IntoIterator, Iterator, Peekable};
use std::sync::Arc;
use style::computed_values::{border_collapse, border_spacing};
use style::context::SharedStyleContext;
-use style::logical_geometry::{LogicalSize, WritingMode};
+use style::logical_geometry::LogicalSize;
use style::properties::ServoComputedValues;
-use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
-use table_row;
+use table::{ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
/// A table formatting context.
pub struct TableRowGroupFlow {
@@ -36,16 +35,9 @@ pub struct TableRowGroupFlow {
/// Information about the intrinsic inline-sizes of each column.
pub column_intrinsic_inline_sizes: Vec<ColumnIntrinsicInlineSize>,
- /// Information about the actual inline sizes of each column.
- pub column_computed_inline_sizes: Vec<ColumnComputedInlineSize>,
-
/// The spacing for this rowgroup.
pub spacing: border_spacing::T,
- /// The direction of the columns, propagated down from the table during the inline-size
- /// assignment phase.
- pub table_writing_mode: WritingMode,
-
/// The final width of the borders in the inline direction for each cell, computed by the
/// entire table and pushed down into each row during inline size computation.
pub collapsed_inline_direction_border_widths_for_table: Vec<Au>,
@@ -63,16 +55,13 @@ impl Serialize for TableRowGroupFlow {
impl TableRowGroupFlow {
pub fn from_fragment(fragment: Fragment) -> TableRowGroupFlow {
- let writing_mode = fragment.style().writing_mode;
TableRowGroupFlow {
block_flow: BlockFlow::from_fragment(fragment),
column_intrinsic_inline_sizes: Vec::new(),
- column_computed_inline_sizes: Vec::new(),
spacing: border_spacing::T {
horizontal: Au(0),
vertical: Au(0),
},
- table_writing_mode: writing_mode,
collapsed_inline_direction_border_widths_for_table: Vec::new(),
collapsed_block_direction_border_widths_for_table: Vec::new(),
}
@@ -150,9 +139,6 @@ impl Flow for TableRowGroupFlow {
shared_context,
containing_block_inline_size);
- let column_computed_inline_sizes = &self.column_computed_inline_sizes;
- let border_spacing = self.spacing;
- let table_writing_mode = self.table_writing_mode;
let collapsed_inline_direction_border_widths_for_table =
&self.collapsed_inline_direction_border_widths_for_table;
let mut collapsed_block_direction_border_widths_for_table =
@@ -167,12 +153,6 @@ impl Flow for TableRowGroupFlow {
_writing_mode,
_inline_start_margin_edge,
_inline_end_margin_edge| {
- table_row::propagate_column_inline_sizes_to_child(
- child_flow,
- table_writing_mode,
- column_computed_inline_sizes,
- &border_spacing);
-
if border_collapse == border_collapse::T::collapse {
let child_table_row = child_flow.as_mut_table_row();
child_table_row.populate_collapsed_border_spacing(